Components
Checkbox
Selectable checkbox for boolean or indeterminate values, built on Radix UI.
Installation
npx asteria-ui add checkboxUsage
import { Checkbox } from "@/components/ui/checkbox";
<Checkbox label="Accept terms and conditions" />Examples
States
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| label | ReactNode | — | Clickable label, linked to the control via for/id. |
| checked | boolean | "indeterminate" | — | Controlled checked state. |
| defaultChecked | boolean | "indeterminate" | — | Uncontrolled initial checked state. |
| onCheckedChange | (checked: boolean | "indeterminate") => void | — | Called when the checkbox is toggled. |
| disabled | boolean | — | Prevents toggling. |
Accessibility
Accessibility
Role.
role="checkbox"witharia-checkedreflecting true / false / mixed — provided by Radix.Keyboard. Space toggles. Radix already handles focus and keyboard behavior; no manual ARIA wiring needed on top of it.
Label. Clicking the label toggles the checkbox (linked via a generated
id/htmlFor).Focus. Visible
glow-focusring on the box itself.