Skip to content

Radio

<ax-radio> represents one value from a mutually exclusive set. Prefer wrapping radios in <ax-radio-group>: the group owns the selected value ([(value)] / CVA), shares a native name, and exposes role="radiogroup". Standalone radios still work via a shared name plus [checked] / (changed).

import { AxRadioComponent, AxRadioGroupComponent } from '@axisui-ng/forms';
<!-- recommended: group owns the model + CVA -->
<ax-radio-group [(value)]="plan" ariaLabel="Plan">
<ax-radio value="free">Free</ax-radio>
<ax-radio value="pro">Pro</ax-radio>
</ax-radio-group>
<!-- standalone (shared name + parent-managed checked) -->
<ax-radio
name="plan"
value="free"
[checked]="plan() === 'free'"
(changed)="plan.set($event)"
>Free</ax-radio>
InputTypeDefaultNotes
valuemodel<string | null>nullSelected value ([(value)]); group is the CVA — bind ngModel / formControlName here.
namestringauto (ax-radio-group-N)Shared native name for all children.
disabledbooleanfalseDisables the whole group (also via CVA setDisabledState).
ariaLabelstring''Accessible name for the radiogroup.
orientation'vertical' | 'horizontal''vertical'Exposed as aria-orientation.
InputTypeDefaultNotes
valuestring (required)Value this radio represents / emits when selected.
namestringauto (ax-radio-N)Group name when standalone; ignored when inside a ax-radio-group (group name wins).
checkedbooleanfalseSelected when standalone; inside a group, selection follows the group value.
disabledbooleanfalseDisabled (OR’d with group disabled / CVA).
ariaLabelstring | nullnullAccessible label when there’s no visible projected label.
OutputPayloadNotes
changedstringOn ax-radio: emits this radio’s value when selected.

Default content on ax-radio is projected as the visible label. ax-radio-group projects its ax-radio children.

Inside a group, the host is role="radiogroup" with native radios sharing one name — arrow keys move/select and form submission work natively. Provide ariaLabel on the group (or wrap with FormField group + groupRole="radiogroup"). Standalone radios rely on a shared name for mutual exclusion.

Interactive examples live in Storybook under Forms / Radio and Forms / RadioGroup. Run pnpm storybook to explore them.