Fieldset
Groups controls that answer one question, such as an address or a contact preference, and every checkbox or radio group. A native fieldset on Base UI's Fieldset, with its legend first.
import {
Fieldset,
FieldsetLeader,
FieldsetLegend,
} from '@fairgarden/design/forms/fieldset'
The legend is authored in title case up to about four words. disabled disables the legend and every control inside it; hiding the group is usually better. Don't nest framed fieldsets, and don't frame ordinary forms: the frame is for technical or printable panels.
Variants and states
Variants and states
text (default) is open: the legend over a hairline rule. outline is the framed panel, the legend set into its --border-size-2-25 top edge. ledger is the dotted frame for self-contained order and checklist forms: lay each row out inline and put a FieldsetLeader between the label and the control.
Primary scale
Primary scale
Structure takes primary only; secondary is accepted and unused.
On grounds
On paper and forest
The hairline, frame and field roles resolve per ground.
paper
forest
API Reference
Fieldset
A Base UI Fieldset: a native fieldset whose first child is a
FieldsetLegend. disabled disables the legend and every control in it;
hiding the group is usually better.
| Prop | Type | Description |
|---|---|---|
primary | | Primary Radix scale: legend, frame and rules. Never defaulted [D133]. |
secondary | | Secondary Radix scale: accepted, unused (structure is primary only). |
variant | |
|
FieldsetLegend and FieldsetLeader
The legend, a native legend: type-field-label in --primary12, title
case up to about four words, sentence case for longer or question
legends [D160]. Open fieldsets draw the hairline rule under it; framed
fieldsets set it into the top edge.
The ledger’s line-dotted-fine leader in --role-rule, running from a
row’s label to its control. Place it between the two in
a row that lays out inline; it grows to fill the space. Decorative.
Additional types
FieldsetLeaderProps
Props for FieldsetLeader: SVG props without children.
type FieldsetLeaderProps = Omit<React.SVGProps<SVGSVGElement>, 'children'>FieldsetLegendProps
Props for FieldsetLegend: Base UI Fieldset.Legend props.
type FieldsetLegendProps = FieldsetLegend.FieldsetLegendPropsFieldsetProps
Props for Fieldset: Base UI Fieldset.Root props plus the variant and color axes.
type FieldsetProps = FieldsetRootProps & {
variant?: 'text' | 'outline' | 'ledger' | null;
primary?:
| 'olive'
| 'sage'
| 'slate'
| 'sand'
| 'gray'
| 'mauve'
| 'brown'
| 'bronze'
| 'gold'
| 'red'
| 'ruby'
| 'crimson'
| 'tomato'
| 'pink'
| 'plum'
| 'indigo'
| 'iris'
| 'violet'
| 'purple'
| null;
secondary?:
| 'olive'
| 'sage'
| 'slate'
| 'sand'
| 'gray'
| 'mauve'
| 'brown'
| 'bronze'
| 'gold'
| 'red'
| 'ruby'
| 'crimson'
| 'tomato'
| 'pink'
| 'plum'
| 'indigo'
| 'iris'
| 'violet'
| 'purple'
| 'amber'
| 'blue'
| 'cyan'
| 'grass'
| 'green'
| 'jade'
| 'lime'
| 'mint'
| 'orange'
| 'sky'
| 'teal'
| 'yellow'
| null;
}Specification: DESIGN-SYSTEM.md §10.2 (field, fieldset and form).