Skip to content

Radio Group for Angular

AngularForm Inputs

Exactly one choice from a short, visible set of mutually exclusive options, built on native radios in a <fieldset role=“radiogroup”> + <legend>, with required validation and native arrow-key selection.

  • One of a fewNative radios with a single tab stop and arrow-key selection from the browser.
  • Group semanticsA fieldset with the radiogroup role and a legend as its accessible name.
  • Option detailsDescriptions under options and disabled options where a choice is unavailable.
  • Required validationLocalized required and custom checks with one message for the group.

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

import { Component } from '@angular/core';
import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
import { AuiRadioGroup } from '@absoluteui/angular/radio-group';
@Component({
selector: 'app-shipping',
imports: [ReactiveFormsModule, AuiRadioGroup],
template: `<aui-radio-group label="Shipping speed" [options]="speeds" [required]="true" [formControl]="speed"></aui-radio-group>`,
})
export class ShippingComponent {
readonly speeds = [
{ value: 'standard', label: 'Standard' },
{ value: 'express', label: 'Express' },
];
readonly speed = new FormControl<string | null>(null, { validators: [Validators.required] });
}
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 { AuiRadioGroup } from '@absoluteui/angular/radio-group';

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

Class AuiRadioGroup; template reference #ref="auiRadioGroup".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Angular forms: implements ControlValueAccessor and Validator; the form value is string \| null. Bind [formControl], formControlName, or [(ngModel)]; validation messages of the component report through the aui error key. See Forms.

Input Type Default Description
label string Required. Legend text and accessible name of the radiogroup.
hideLabel boolean false Visually hide the legend; it remains the accessible name.
options readonly RadioGroupOption[] Required. Choices; values must be unique.
name string Native radio name; a unique name is generated when absent.
description string Group help text referenced by the radiogroup’s aria-describedby.
required boolean false A selection is required (aria-required on the radiogroup, native required on radios).
orientation RadioGroupOrientation 'vertical' Layout of the options.
disabled boolean false Disables the whole group (fieldset disabled).
validate (value: string | null) => string | null Consumer validation; return a message to mark the selection invalid.
icons Partial<RadioGroupIcons> Icon slot overrides.
validationTiming ValidationTiming 'blur' When validation messages first appear; afterwards they update live.
locale string 'en-US' Message locale.
Model Type Change output Description
[(value)] string | null (valueChange) The value: [(value)] without forms; with Angular forms, bind the form control instead.
Output Payload Description
(changed) RadioGroupChangeDetail The user selected an option (click, Space, or arrow keys). Re-emits aui-change.

Call them through a viewChild query or a template reference.

Method Description
reportValidity(): boolean | undefined Show messages now and return validity.
setCustomError(message: string | null): void External error; cleared when the selection changes.
getFormValue(): string | null | undefined Selected value for form serialization.
focus(): void Focus the selected radio, else the first enabled radio.
reset(): void Restore the initial selection and clear dirty/touched/submitted state.

AuiRadioGroupHarness from @absoluteui/angular/testing. <aui-radio-group>.

Pattern: Native radios sharing one name inside <fieldset role=“radiogroup”> + <legend> (WAI-ARIA APG Radio Group, native keyboard model).

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