Checkbox

Displays a boolean value.

General

Change state with checked props.

sizes

Checkbox of different sizes.

Type

Differentiate states by color.

disable

group

Manage a set of Checkbox.

APIs

Checkbox.Props

AttributeDescriptionTypeAccepted valuesDefault
checkedchecked or notboolean--
initialCheckedchecked or not on initialboolean-false
onChangechange event handlerCheckboxEvent--
valueunique identification value (only in group)string--
disableddisable checkboxboolean-false
typecurrent typeCheckboxTypesCheckboxTypesdefault
refforwardRefRef<HTMLInputElement or null>--
...native propsLabelHTMLAttributes'form' ...-

Checkbox.Group.Props

AttributeDescriptionTypeAccepted valuesDefault
valuechecked childrenArray<string>-[]
disableddisable checkbox groupboolean-false
onChangechange event handler(values: string[]) => void--
...native propsHTMLAttributes'id', ...-

CheckboxTypes

type CheckboxTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'

CheckboxEvent

interface CheckboxEventTarget {
  checked: boolean
}

export interface CheckboxEvent {
  target: CheckboxEventTarget
  stopPropagation: () => void
  preventDefault: () => void
  nativeEvent: React.ChangeEvent
}