Use legend to name the group and project its controls. disabled applies native fieldset semantics; also bind disabled on custom controls so their visual and interaction state match the group. collapsible adds a legend toggle; collapsed plus collapsedChange allows controlled collapse. Without collapsed the component manages its own state.
collapsedChange proposes a collapse state when collapsed is supplied. Controls retain their individual value models; Fieldset does not create a form model or validation API.
The legend names the form group. Its collapse button supports Tab, Enter and Space and is disabled with the group. Each projected control still needs its own accessible label.
Key
Action
Tab
Reach the enabled collapse button and focusable content.
Enter
On the collapse button, expand or collapse the content when available.
Space
On the collapse button, expand or collapse the content when available.
Inputs and Outputs match the pinned Core package. Named types link to their definitions. Templates include executable examples for each supported region.
Inputs
Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.
Name
Type
Default
Template binding
Description
collapsed
boolean | undefined
undefined
[collapsed]
Applied collapse state; omit for internal state.
collapsible
boolean
false
[collapsible]
Show an expandable legend button.
disabled
boolean
false
[disabled]
Disable the native group; bind the same state to custom children.
legend
string
''
[legend]
Visible and accessible group name.
Outputs
Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.
Name
Payload
Template binding
Description
collapsedChange
boolean
(collapsedChange)="onCollapsedChange($event)"
Proposes the next collapse state when controlled.
Templates
ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.