Checkbox
Checkbox
Section titled “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
Section titled “Import”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" />Inputs & models
Section titled “Inputs & models”| Input | Type | Default | Notes |
|---|---|---|---|
checked | model<boolean> | false | Two-way checked state ([(checked)]); also CVA. |
indeterminate | boolean | false | Mixed state — visual + aria-checked="mixed"; takes precedence over checked. Consumer owns clearing it. |
disabled | boolean | false | Disabled (also via CVA setDisabledState). |
ariaLabel | string | null | null | Accessible label when there’s no visible projected label. |
describedBy | string | null | null | aria-describedby. |
Default content is projected as the visible label next to the control (inside the wrapping <label>).
Accessibility
Section titled “Accessibility”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".
Storybook
Section titled “Storybook”Interactive examples live in Storybook under Forms / Checkbox. Run pnpm storybook to explore them.