Fieldset
An unstyled semantic group for form fields with accessible legend/description linking and nested disabled inheritance.
Base Fieldset groups related form fields with accessible naming, optional help descriptions, and nested disabled inheritance.
Preview
Section titled “Preview” Web Components React Vue Vue 2
Loading interactive preview… The article and source are ready to read. Interactive controls will appear here when ready.
Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases.
Anatomy
Section titled “Anatomy”Compose Root, Legend, and Description:
Root: declares thegrouprole and computes effectivedisabled, named byariaLabelor a childLegend.Legend(optional): passive group heading automatically linked viaaria-labelledby, adding no extra Tab stop.Description(optional): passive help text automatically linked viaaria-describedby.- Each group allows at most one
Legendand oneDescription; nested Fieldsets keep their naming and description links isolated.
Nested disabled inheritance
Section titled “Nested disabled inheritance”disabled propagates downward to nested Fieldsets and participating Field controls (including any field placed inside a Legend):
- Disabling an outer Fieldset disables all nested groups inside it.
- If a middle group is also disabled and the outer group is re-enabled, the middle and inner groups stay disabled.
- A group becomes enabled only when both its ancestors and its own
disabledprop arefalse.
Root Props
Section titled “Root Props”These props belong to Root. All three parts expose the read-only effective disabled state.
| Prop | Type | Default |
|---|---|---|
disabled | boolean | false |
ariaLabel | string | '' |
Other parts
Section titled “Other parts”- Legend, Description: no props.