Skip to content
GitHub (opens in a new tab)

FieldSet

Semantic group of fields with a legend and optional description. This is the form group.

stableMoleculecontracts/fieldset.json

Preview

FieldSet

A legend and optional description around related fields. This is the form group. A single labeled control stays Field.

Master

Legend, description, and kit fields. Do not add FieldLegend, FieldGroup, or Form.

Billing address

Used on invoices and receipts.

Usage

FieldSet is the form group. One Field stands alone. Page titles stay on PageHeader.

Do's

  • Related fields that need a shared heading, like billing or profile
  • A checkbox or switch sitting under a group legend
  • Form chrome — FieldSet is the form; do not invent Form

Don'ts

<FieldSet legend="Billing address" description="Used on invoices and receipts.">
  <Field label="Street" htmlFor="street">
    <Input id="street" placeholder="123 Market St" />
  </Field>
  <Field label="City" htmlFor="city">
    <Input id="city" placeholder="San Francisco" />
  </Field>
</FieldSet>

When to use

  • Related fields that need a shared heading, like billing or profile
  • A checkbox or switch sitting under a group legend
  • Form chrome — FieldSet is the form; do not invent Form

When not to use

  • A single labeled control — use Field
  • Page title — use PageHeader or Card title

What an agent reads

import { FieldSet } from "agentic-ds-kit";
must
  • legend is the accessible name of the group
  • description is linked with aria-describedby
  • side keeps the legend as the group's name; reading order stays legend, description, fields
defaults
  • layout stack
stops if
  • Do not invent FieldLegend, FieldGroup, FieldSeparator, Form, or FormDisplay — FieldSet is the form group
  • Do not nest FieldSet unless the inner group is truly nested
  • Do not use raw hex

From contracts/fieldset.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
legendstringYes——
descriptionstringNo—Linked to the fieldset with aria-describedby, so it is read with the legend on first focus.
layoutstack | sideNostackstack: legend and description above the fields. side: legend (16/24, heading weight) and description in a fixed left column (--layout-sidebar plus 24) with the fields 48 to the right; stacks when the FieldSet is under 40rem wide. Use side for the groups of a wide settings form in one Card.
childrenslotYes—kit Field, Checkbox, Switch, or RadioGroup
  • Component
    →

    Field

    One labeled control with optional hint and an error or success message.

  • Component
    →

    PageHeader

    Top-of-page title with optional Breadcrumb trail, subtitle, actions, page Tabs, a profile Avatar and a decorative cover.

  • Component
    →

    Card

    Framed tile with optional header, body, and footer actions.

  • Component
    →

    TaskBrief

    The brief a person hands an agent before it plans: a goal, one-line "done when" checks, optional spend, time and step limits, allowed tools, model and check-in level.