Checkbox
v0.5.0StableA 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 invalid (adds the --invalid modifier and sets aria-invalid) to visually mark the checkbox as invalid (pair with FormField's error prop for the message).
Examples
Open all 6 →Properties
Checkbox props
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | — | — |
className | string | — | Additional class names to merge with the component root element |
invalid | boolean | false | Marks the field as invalid: adds the `--invalid` modifier and sets `aria-invalid="true"` |
Also accepts the native attributes of its root element (className, aria-*, event handlers, …).