Checkbox
v0.4.0A bare checkbox control (built on Radix's `Checkbox`) — the Radix checkbox button is this component's own root element. It has no built-in label/hint/error; wrap it in `FormField` for that chrome.
A bare checkbox control (built on Radix's Checkbox) — the Radix checkbox button is this component's own root element. It has no built-in label/hint/error; wrap it in FormField for that chrome.
Usage
Pass aria-invalid="true" to visually mark the checkbox as invalid (pair with FormField's error prop for the message).
Props
Extends Radix's own CheckboxProps (checked, defaultChecked, onCheckedChange, disabled, required, name, value, id, plus any standard button/ARIA attribute) with:
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional class names |
Compositions
Open all 6 →Properties
Checkbox props
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — | — |
className | string | — | Additional class names to merge with the component root element |
Also accepts the native attributes of its root element (className, aria-*, event handlers, …).