Skip to content

Fieldset for Angular

AngularForms

Enhances a native fieldset that groups related controls (an address, a date of birth, contact preferences) with the AbsoluteUI legend, help text, required marker, and a group-level error. The controls stay in place; the native element provides the group semantics and disabled state.

  • Native groupingEnhances a native fieldset, keeping its controls in place and its built-in group semantics.
  • Legend and helpA styled legend that can be visually hidden, plus group help text read with the group.
  • Group-level errorOne error message for the whole group, for checks no single control can make.
  • Disable in one stepThe native disabled state turns off every control inside the group.

Behavior, design tokens, and limitations are described on the Fieldset page; this page covers the Angular API.

import { Component } from '@angular/core';
import { AuiFieldset } from '@absoluteui/angular/fieldset';
import { AuiTextInput } from '@absoluteui/angular/text-input';
@Component({
selector: 'app-address',
imports: [AuiFieldset, AuiTextInput],
template: `
<fieldset auiFieldset legend="Delivery address" [required]="true" [error]="error">
<aui-text-input label="Street" autocomplete="address-line1"></aui-text-input>
<aui-text-input label="City" autocomplete="address-level2"></aui-text-input>
</fieldset>`,
})
export class AddressComponent {
error: string | null = null;
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiFieldset } from '@absoluteui/angular/fieldset';

Defaults for every instance: provideAbsoluteUIConfig({ components: { fieldset: { ... } } }) (see Configuration).

Class AuiFieldset; template reference #ref="auiFieldset".

AbsoluteUI Fieldset: <fieldset auiFieldset legend="Address">...controls...</fieldset>. Enhances the native fieldset in place with the legend, help text, required marker, and a group error; the projected controls stay Angular-managed. Disabled is the native attribute.

Server rendering: Renders in the browser only; on the server the element stays empty.

Input Type Default Description
legend string Required. Visible legend; the group’s accessible name.
hideLegend boolean false Visually hide the legend (it stays the accessible name).
description string Help text for the group, referenced by aria-describedby.
required boolean false Required marker; ‘(required)’ is added to the spoken legend.
error string | null Group-level error message; empty or null hides it.
locale string 'en-US' Locale of the required text.
icons Partial<FieldsetIcons> Icon slot overrides.

Pattern: Native fieldset and legend (HTML grouping): the legend names the group; help and the group error are referenced by aria-describedby.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Fieldset: Accessibility and performance.