Checkbox
A control that allows the user to toggle between checked and not checked.
Installation
import { Checkbox } from "@sourceful-energy/ui"Usage
Examples
Default Checked
Disabled
With Description
Receive updates about your energy usage.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean | 'indeterminate' | false | The controlled checked state. |
| defaultChecked | boolean | false | The default checked state when uncontrolled. |
| onCheckedChange | (checked: boolean) => void | - | Callback when the checked state changes. |
| disabled | boolean | false | Whether the checkbox is disabled. |
| id | string | - | The ID for associating with a label. |
Accessibility
- Uses native checkbox semantics via Radix UI
- Supports keyboard navigation (Space to toggle)
- Always pair with a Label for screen readers
- Supports indeterminate state