Checkbox

A checkbox input built on Radix UI Checkbox. Supports checked, unchecked, and indeterminate states, with full keyboard accessibility and disabled support.

Built on Radix UI.

  • Checked, unchecked, and indeterminate states
  • Fully keyboard accessible — toggle with Space
  • Controlled and uncontrolled usage
  • Disabled state with visual feedback
  • Integrates with Label via htmlFor/id

import { Checkbox }from "@aetherstack/ui"

checkbox.tsx
"use client"
import { useState } from "react"
import { Checkbox } from "@/components/ui/checkbox"
import { Label } from "@/components/ui/label"

export function CheckboxDemo() {
  const [checked, setChecked] = useState(false)
  return (
    <div className="flex items-center space-x-2">
      <Checkbox
        id="terms"
        checked={checked}
        onCheckedChange={(value) => setChecked(Boolean(value))}
      />
      <Label htmlFor="terms">
        {checked ? "Checked" : "Unchecked"}
      </Label>
    </div>
  )
}

Usage

With label

Disabled

Checkbox group

Build multi-select groups by rendering multiple checkboxes.

Notification preferences

Indeterminate

Use the indeterminate state for a parent checkbox that represents a partially-selected group.

Props

PropTypeDefaultDescription
checkedboolean | 'indeterminate'Controlled checked state. Pass 'indeterminate' for the partial-selection state.
defaultCheckedbooleanfalseUncontrolled initial checked state.
onCheckedChange(checked: boolean | 'indeterminate') => voidCallback fired when the checked state changes.
disabledbooleanfalsePrevents interaction and applies reduced opacity.
requiredbooleanfalseMarks the checkbox as required in a form.
namestringThe name of the checkbox for form submission.
valuestring"on"The value submitted with the form when the checkbox is checked.
classNamestringAdditional class names on the root element.

* Required props

Accessibility

  • Uses the native checkbox role — screen readers announce checked/unchecked/indeterminate state automatically.
  • Always provide a visible label via Label with matching htmlFor, or aria-label for icon-only checkboxes.
  • Space key toggles the checkbox. Tab moves focus.
  • The indeterminate state is announced as 'mixed' by screen readers.