Docs / Components

SenseFieldsetComponent

Form grouping surface from @artificialsenselabs/ui with legend, optional collapse, and content projection for related controls.

Live demo: run nx serve showcase and open /components/fieldset (port 4202).

Overview

Category: Form / layout. Selector: sense-fieldset. Import: import { SenseFieldsetComponent } from '@artificialsenselabs/ui';

<sense-fieldset legend="Account" [toggleable]="true">
  <sense-input label="Email" />
</sense-fieldset>

Content slots

SelectorRegion
[fieldsetLegend]Custom legend markup (alternative to legend input).
(default)Grouped field content.

Inputs

InputTypeDefaultDescription
legendstring''Legend label text.
toggleablebooleanfalseEnables collapsible legend disclosure control.
collapsedbooleanfalseTwo-way bindable collapse state.
toggleLabelstring | nullnullToggle aria-label when legend is empty; falls back to i18n.
styleClassstring | nullnullAdditional host classes.

Outputs

OutputPayloadDescription
toggled{ collapsed: boolean }Emitted when collapse state changes.

Accessibility

  • Host exposes role="group" with aria-labelledby pointing at the legend.
  • Toggleable legends use role="button", aria-expanded, and aria-controls.
  • Collapsed content is hidden with aria-hidden="true" on the content wrapper.
  • Keyboard: Enter and Space toggle when toggleable is true.

APG reference: WAI-ARIA disclosure pattern.