Checkbox
A native browser checkbox input with label to toggle between two states. Similar to Switch input, internal checked and unchecked states can be set to any value, not just boolean true
or false
.
Has Universal Input API, with input value
format
,parse
,normalize
and event action handlers.
Props
Prop | Type | Default | Description |
---|---|---|---|
label | String | Text to use for checkbox, uses | |
id | String | Unique identifier, default is string created from React.useId() | |
onChange | Function | Input onChange callback(event, value: any, name?: string, self: object) | |
value | Any | Internal value for controlled checked or unchecked state | |
defaultValue | Any | Initial value for uncontrolled checked or unchecked state | |
checkedValue | Any |
| Internal value to assign to checked case |
uncheckedValue | Any |
| Internal value to assign to unchecked case |
readonly | Boolean | Whether to disable toggling state |
Examples
Basic Usage
Checkbox Sizes
Input States
Input Values
For more native input type examples, see Universal Checkbox Input.