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.
Checkboxes
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
legend | ReactNode | — | Name of the group |
description | ReactNode | — | Helper text below the controls |
error | ReactNode | — | Error message below the controls |
required | boolean | false | Shows the required indicator on the legend |
disabled | boolean | false | Disables every Field in the group |
sx | StyleXStyles | — | StyleX style override for the root |
legendSx | StyleXStyles | — | StyleX style override for the legend |
descriptionSx | StyleXStyles | — | StyleX style override for the description |
errorSx | StyleXStyles | — | 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 througharia-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. requiredonly adds the visual asterisk. Also setrequiredon the controls.