Skip to main content

Checkbox

A simple boolean checkbox.

Examples

Plain Checkbox

<Checkbox
size="small|medium(default)"
checked
indeterminate
/>

With label

<Checkbox 
...
label="A checkbox with a label"
meta="And some meta text"
/>

With Critical, Warning, Success, and Disabled States

<Checkbox
state="''(default)|critical|warning|success"
/>

With children

Child content only visible when checked.
Child content only visible when checked.
Child content always visible.
Child content always visible.
<Checkbox 
...
alwaysShowChildren
/>

Controlled Checkbox

<Checkbox
size="small|medium(default)"
checked
indeterminate
onChange={(evt, checked) => ...}
/>

As a list

<CheckboxGroup
name="labeled"
values={['a']}
label="A list of radio choices"
helperText="Just pick one"
onChange={(evt, values) => ...}
>
<Checkbox value="a" />
<Checkbox value="b" />
<Checkbox value="c" />
</CheckboxGroup>

Props

NameTypeDefault ValueRequiredDescription
alwaysShowChildrenbooleanfalseNoShould the children display even if `checked=false`?
indeterminatebooleanfalseNoShow a partially selected checkbox when `checked=true`.
labelReactNodeNoA string or component to display as a label above the input
metaReactNodeNoA string or component to display as meta text beneath the input
onChangeFormControlChangeEventHandler<InputType, string | number | readonly string[] | (string | number | readonly string[])[]> | undefinedNoEmit a new value when the input's selected value changes.
size"small" | FormControlSize | "medium"FormControlSize.MediumNoThe size of the field
state"" | FormControlState | "critical" | "warning" | "success"FormControlState.DefaultNoThe state of the field

Enums

FormControlSize

KeyValue
Small"small"
Medium"medium"

FormControlState

KeyValue
Default""
Critical"critical"
Warning"warning"
Success"success"