An on, off or mixed choice. Renders a hidden native checkbox so it submits, validates and resets with the form.
import Checkbox from "@radui/ui/Checkbox"- Checked, unchecked and indeterminate states, controlled or uncontrolled
- Renders a hidden native checkbox: submits under name, honours required, resets with the form
- uncheckedValue submits a value while unchecked; form targets a form elsewhere on the page
- Space toggles it; the state is announced through aria-checked
- Works inside Field.Root without extra wiring
Import all parts of the component and piece them together.
The root checkbox element.
| Prop | Type | Default |
|---|---|---|
checked | boolean | false |
defaultChecked | boolean | false |
disabled | boolean | false |
required | boolean | false |
onCheckedChange | function | — |
color | string | "" |
size | string | "" |
variant | string | "" |
customRootClass | string | "" |
readOnly | boolean | false |
indeterminate | boolean | false |
uncheckedValue | string | — |
form | string | — |
inputRef | Ref<HTMLInputElement> | — |
Renders the checkmark icon when the checkbox is checked.
| Prop | Type | Default |
|---|---|---|
className | string | "" |
forceMount | boolean | false |
| Shortcut | Description |
|---|---|
| Tab | Moves focus to the checkbox. |
| Space | Toggles between checked and unchecked states. |
| Reference | What Rad UI follows |
|---|---|
| Checkbox pattern | Uses checkbox semantics with aria-checked to expose checked, unchecked, or mixed state. |