Checkbox
A checkbox is an input control that allows a user to select one or more options from a number of choices.
Use Field to compose a label, helper text, and validation message around this control.
Usage
Size
With label
Disabled
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | 'sm' | 'md' | 'lg' | 'md' | Size of the checkbox |
checked | boolean | false | Whether the checkbox is checked |
defaultChecked | boolean | - | The default checked state for uncontrolled usage |
onCheckedChange | (checked: boolean) => void | - | Callback when the checked state changes |
disabled | boolean | false | Whether the checkbox is disabled |
id | string | - | HTML id attribute for label association |