Fieldset

Groups several related form fields together within a single form.

Use Fieldset...

  • To group multiple related form fields together

Don't use Fieldset...

Usage

The preview has been updated.

Accessibility

  • All <fieldset> tags must have a <legend> tag that labels them, for accessibility. If the information in the legend is superfluous to sighted users, the legend can be hidden on screens by using VisuallyHidden see docs here.
  • The <legend> cannot be (or contain) a heading (H1-H6) tag. If the page structure requires a heading to label the form fields, don't use a <fieldset> tag. Instead, group them using a wrapper tag that has the role="radiogroup" attribute (for radio buttons) or role="group" attribute (for everything else), plus an aria-labelledby attribute whose value is the id of the heading.

Props

See core props for additional props that can be applied to each of these components. Each component also accepts the React-equivalent native HTML attributes of the element it renders, unless a listed prop replaces one or a note says otherwise.
FieldSet
Renders <fieldset>. No props beyond core props and native HTML attributes.
Other components
These components have no props beyond core props and native HTML attributes.
ComponentRendersNotes
FieldSetLegend<legend>

Related