Skip to content

Form Field for Angular

AngularForm Infrastructure

Gives a consumer-owned native <input>, <textarea>, or <select> the AbsoluteUI field chrome and validation: label, required indicator, help text, localized messages mapped from the browser’s ValidityState, the shared message timing, and Form integration. The control element stays the consumer’s; only its ARIA wiring and the surrounding chrome are managed.

  • Your control staysWraps a native input, textarea, or select in place without cloning or re-creating it.
  • Complete field chromeAdds the label, required marker, help text, and validation message with correct ARIA wiring.
  • Localized messagesMaps the browser's validity state to consistent AbsoluteUI messages in every browser.
  • Form integrationRegisters with Form, so wrapped native fields validate, submit, and reset with the rest.

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

import { Component } from '@angular/core';
import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
import { AuiFormField } from '@absoluteui/angular/form-field';
@Component({
selector: 'app-guests',
imports: [ReactiveFormsModule, AuiFormField],
template: `
<aui-form-field label="Number of guests" description="Up to 8 people" [required]="true">
<input type="number" name="guests" min="1" max="8" [formControl]="guests" />
</aui-form-field>`,
})
export class GuestsComponent {
readonly guests = new FormControl<number | null>(null, { validators: [Validators.required, Validators.min(1), Validators.max(8)] });
}
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 { AuiFormField } from '@absoluteui/angular/form-field';

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

Class AuiFormField; template reference #ref="auiFormField".

AbsoluteUI Form Field around a projected native control: <aui-form-field label="ZIP"><input formControlName="zip" required></aui-form-field>. The native control keeps Angular’s own value accessor; AbsoluteUI adds the label, help text, and localized validation messages.

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

Input Type Default Description
label string Required. Visible label and accessible name (<label for> the control).
hideLabel boolean false Visually hide the label; it remains the accessible name.
description string Help text referenced by aria-describedby.
required boolean Sets the native required property and the indicator. When omitted, the control’s own required attribute is used.
validate (value: FormFieldValue) => string | null Consumer validation after native constraints; return a message to mark the value invalid. string[] for <select multiple>.
validationTiming ValidationTiming 'blur' When validation messages first appear; afterwards they update live.
locale string 'en-US' Message and number-formatting locale.
icons Partial<FormFieldIcons> Icon slot overrides.
Output Payload Description
(valueInput) FormFieldChangeDetail Native input event on the control. Re-emits aui-input.
(changed) FormFieldChangeDetail Native change event on the control. Re-emits aui-change.

Call them through a viewChild query or a template reference.

Method Description
reportValidity(): boolean Show messages now; true when valid.
setCustomError(message: string | null): void External error (server, cross-field rule); cleared when the user edits.
refresh(): void Re-read the control’s constraints after changing them outside AbsoluteUI.
focus(): void Focus the wrapped control.
reset(): void Clear touched state and messages.

Pattern: Native form control with a <label for> association (HTML); the consumer’s element keeps its native role.

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