Fieldset
Fieldset groups related fields under a shared legend. It renders a semantic <fieldset> — the
legend names the group for everyone, including assistive technology.
What it is
A <Box as="fieldset"> with a bordered surface and an optional legend. Fieldset groups Fields,
not controls directly — each control inside still belongs to its own Field for the id wiring.
Fieldset adds the outer grouping and the group name.
Install
Fieldset is exported from usemotif. No separate install.
API
Fieldset
stablefunction Fieldset(props: FieldsetProps): JSX.Element
The group name. Rendered as a `<legend>` — omit it only when a visible heading elsewhere already names the group.
Every Box prop except `as` — Fieldset always renders `<fieldset>`.
Accessibility
The <fieldset> / <legend> pair is the native grouping mechanism. A screen reader announces the
legend when focus enters any control in the group, so a user always knows which set of fields they
are filling in. This matters most for groups where the controls share meaning only collectively —
a radio group, an address block, a date split across three inputs.
Supply a legend unless a visible heading immediately before the Fieldset already names the
group. A <fieldset> with no legend gives the group a border but no name.
Examples
An address block: