Skip to content

Checkbox

<ax-checkbox> is a boolean toggle. It implements ControlValueAccessor over a native <input type="checkbox">, so it submits correctly in forms and binds two-way via [(checked)], [(ngModel)], or reactive forms. Use Checkbox for “yes/no I agree” options; prefer Switch for on/off feature toggles.

import { AxCheckboxComponent } from '@axisui-ng/forms';
<ax-checkbox [(checked)]="agree" ariaLabel="I agree to the terms">
I agree to the terms
</ax-checkbox>
<!-- indeterminate parent (consumer clears on next toggle) -->
<ax-checkbox [(checked)]="allSelected" [indeterminate]="someSelected" ariaLabel="Select all" />
InputTypeDefaultNotes
checkedmodel<boolean>falseTwo-way checked state ([(checked)]); also CVA.
indeterminatebooleanfalseMixed state — visual + aria-checked="mixed"; takes precedence over checked. Consumer owns clearing it.
disabledbooleanfalseDisabled (also via CVA setDisabledState).
ariaLabelstring | nullnullAccessible label when there’s no visible projected label.
describedBystring | nullnullaria-describedby.

Default content is projected as the visible label next to the control (inside the wrapping <label>).

Backed by a native checkbox, so keyboard (Space) and form semantics work for free. Provide either projected label text or ariaLabel. When indeterminate is set, aria-checked is "mixed".

Interactive examples live in Storybook under Forms / Checkbox. Run pnpm storybook to explore them.