Checkbox
Checkboxes allow users to select any number of options from a list.
Props
Name | Type | Default | Description |
---|---|---|---|
labelText | string | Label for the input | |
onChange | function | null | |
required | boolean | false | Makes the field require input before the form will submit |
checked | boolean | false | Whether or not the checkbox has been checked |
indeterminate | boolean | false | Displays the checkbox in an indeterminate state if checked. You must use the checkbox as a controlled input (give the checked prop a value) when using this prop |
value | string | The value of the checkbox that is submitted with the form. Required when using `indeterminate` checkbox. | |
disabled | boolean | false | Marks the field as disabled and disallows user input |
error | boolean | false | Marks the field as invalid and turns red |
id | string | A unique ID for this input | |
name | string | Identified that groups inputs together | |
defaultChecked | boolean | false | Makes the field checked by default |
className | string | className passed to the wrapper |