Displays a boolean value.
Change state with checked
props.
Checkbox of different sizes.
Manage a set of Checkbox
.
Checkbox.Props
Attribute | Description | Type | Accepted values | Default |
---|---|---|---|---|
checked | checked or not | boolean | - | - |
initialChecked | checked or not on initial | boolean | - | false |
onChange | change event handler | CheckboxEvent | - | - |
value | unique identification value (only in group) | string | - | - |
disabled | disable checkbox | boolean | - | false |
size | checkbox size | NormalSizes | NormalSizes | small |
... | native props | LabelHTMLAttributes | 'form', 'className', ... | - |
Checkbox.Group.Props
Attribute | Description | Type | Accepted values | Default |
---|---|---|---|---|
value | checked children | Array<string> | - | [] |
disabled | disable checkbox group | boolean | - | false |
onChange | change event handler | (values: string[]) => void | - | - |
size | size of all checkboxes in the group | NormalSizes | NormalSizes | small |
... | native props | HTMLAttributes | 'id', 'className', ... | - |
NormalSizes
type NormalSizes = 'mini' | 'small' | 'medium' | 'large'
CheckboxEvent
interface CheckboxEventTarget {
checked: boolean
}
export interface CheckboxEvent {
target: CheckboxEventTarget
stopPropagation: () => void
preventDefault: () => void
nativeEvent: React.ChangeEvent
}