Skip to main content

Components

Fieldset

Fieldset is used to group and label fields that naturally belong together, such as date fields or address fields. The component helps organize information, make forms more manageable, and improve accessibility for screen readers.

It is common to get confused between Fieldset and Field. A good rule of thumb is that Fieldset is a set of Field

Usage

Examples

With checkbox

Both Checkbox and Radio should be grouped in a Fieldset, even if there is only one element in the group.

More fields

Legend as heading

If it is a page that only has form on it, and the title of the page (<h1>) is the same as what will be in <legend>, you can put <h1> inside Fieldset.Legend.

HTML

The class name ds-fieldset is added to the <fieldset> element.

CSS variables and data attributes

No relevant css variables found.

No relevant data attributes found.

Edit this page on github.com (opens in a new tab)