Playground
Checked
Disabled
Checkbox
Indeterminate
"Select all" shows indeterminate (a dash) when some but not all items are checked — check/uncheck items above to see it update live.
Radio
Tab to any control above and use arrow keys (radio) or space (checkbox) to see native keyboard behavior.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | — | Text shown next to the control. |
| checked / defaultChecked | boolean | false | Standard native checked state. |
| indeterminate | boolean | false | Checkbox only. Renders a dash instead of a checkmark, for a "select all" control when only some children are checked. Set via the DOM property, not a real HTML attribute. |
| disabled | boolean | false | Standard HTML disabled state. |
| name | string | — | Radio uses this to group mutually-exclusive options. |
| ...rest | InputHTMLAttributes | — | onChange, value, and any other native input prop. |
Usage Guidelines
When to use
- Use Checkbox for independent, multi-select choices — any combination can be checked at once.
- Use Radio for a mutually exclusive single choice from a fully visible list of options.
When not to use
- Don't use Radio for more than five or six options — switch to Select once the list gets long.
- Don't use Checkbox to represent a single binary on/off setting — use Switch instead.