Checkbox
Examples
Loading examples…
API
From COMPONENTS.md.
import { Checkbox } from 'achery-ui'
<Checkbox label="Accept terms" />
<Checkbox checked={done} onChange={setDone} label="Mark done" />
<Checkbox checked="indeterminate" onChange={handleAll} label="Select all" />
<Checkbox checked disabled label="Locked" />
| Prop | Type | Default | Notes |
|---|---|---|---|
checked |
boolean | 'indeterminate' |
— | Controlled state |
defaultChecked |
boolean | 'indeterminate' |
— | Uncontrolled initial state |
onChange |
(v: boolean | 'indeterminate') => void |
— | |
disabled |
boolean |
— | |
label |
ReactNode |
— | Rendered as associated <label> |
aria-label |
string |
— | Use when no visible label |
id |
string |
auto | Auto-generated when label is set |
className |
string |
— |
A ticked box fills with the accent under the chrome and surface dials, and with ink under underline.