Fieldset

Groups related controls, such as a RadioGroup or a set of checkboxes, under one legend.

Import

import { Fieldset } from '@matix/components/fieldset';

Usage

Use Fieldset for a group of controls that share one name. Use Field for one control.

Plan

You can change the plan later.

Checkboxes

Notifications

Choose at least one channel.

API Reference

PropTypeDefaultDescription
legendReactNode—Name of the group
descriptionReactNode—Helper text below the controls
errorReactNode—Error message below the controls
requiredbooleanfalseShows the required indicator on the legend
disabledbooleanfalseDisables every Field in the group
sxStyleXStyles—StyleX style override for the root
legendSxStyleXStyles—StyleX style override for the legend
descriptionSxStyleXStyles—StyleX style override for the description
errorSxStyleXStyles—StyleX style override for the error message

All other props go to the underlying Base UI Fieldset.

Accessibility

  • Renders a native <fieldset>. The legend names the group through aria-labelledby, and screen readers announce it when focus enters the group.
  • The description and the error connect to the group through aria-describedby.
  • Do not wrap a RadioGroup or a set of checkboxes in Field. The Field label is a <label> for one control, so a click on it selects the first option.
  • required only adds the visual asterisk. Also set required on the controls.