✦ Asteria UI
Components

Checkbox

Selectable checkbox for boolean or indeterminate values, built on Radix UI.

Installation

npx asteria-ui add checkbox

Usage

import { Checkbox } from "@/components/ui/checkbox";

<Checkbox label="Accept terms and conditions" />

Examples

States

API reference

PropTypeDefaultDescription
labelReactNodeClickable label, linked to the control via for/id.
checkedboolean | "indeterminate"Controlled checked state.
defaultCheckedboolean | "indeterminate"Uncontrolled initial checked state.
onCheckedChange(checked: boolean | "indeterminate") => voidCalled when the checkbox is toggled.
disabledbooleanPrevents toggling.

Accessibility

Accessibility

  • Role. role="checkbox" with aria-checked reflecting 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-focus ring on the box itself.