Checkboxes
Checkboxes can be either checked, unchecked or indeterminate.
Props
Property | Required | Type | Default | Description |
---|---|---|---|---|
checked | false | boolean | Whether the checkbox is checked, when controlled | |
children | false | node | Content to place within label to the right of the checkbox | |
className | false | string | Class name to put on outer div element | |
defaultChecked | false | boolean | Whether the checkbox is checked, when uncontrolled | |
disabled | false | boolean | Whether the checkbox is disabled | |
id | false | string | Auto-generated unique ID with prefix "checkbox" | ID to put on the inner input[type="checkbox"] |
indeterminate | false | boolean | Puts checkbox into an indeterminate state | |
labelClassName | false | string | Class name to put on the checkbox label | |
name | false | string | Name to set on inner input[type="checkbox"] | |
noSelect | false | boolean | When true , prevents the label text from being selectable | |
onChange | false | func | onChange callback to set on inner input[type="checkbox"] | |
style | false | object | Style to put on outer div element |
All other props will be put onto the inner input[type="checkbox"]
.
Imports
Import React components (including CSS):
import {Checkbox} from 'pivotal-ui/react/checkbox';
Import CSS only:
import 'pivotal-ui/css/checkbox';