Checkbox

Displays a boolean value.

Import

import { Checkbox } from 'raw-ui';

Default

Checked

With label

Controlled

Indeterminate

Disabled

Group

Indeterminate with group

API

Checkbox

PropDescriptionTypeDefault
defaultCheckedchecked or not by default (uncontrolled)booleanfalse
checkedchecked or not (controlled)boolean-
valueunique identification value (only in group)string | number-
indeterminatePartially checkedbooleanfalse
disableddisable current checkboxbooleanfalse
onChangechange event handler(event: React.ChangeEvent<HTMLInputElement>) => void-
...native propsReact.LabelHTMLAttributes-

CheckboxGroup

PropDescriptionTypeDefault
defaultValuedefault checked items (uncontrolled)Array<string | number>-
valuechecked items (controlled)Array<string | number>-
disableddisable all itemsbooleanfalse
layoutvertical layout'row' | 'column''row'
onChangechange event handler(value: Array<string | number>) => void-
...native propsReact.HTMLAttributes-