BenixBenix DSv1.1.0

Checkbox

Controlled checkbox built on Radix. Supports indeterminate, inline label and description.

Examples

With inline label

Required to continue.

<Checkbox
label="Accept terms"
description="Required to continue."
checked={checked}
onCheckedChange={(v) => setChecked(Boolean(v))}
/>

Group

<Checkbox label="Email notifications" defaultChecked />
<Checkbox label="SMS notifications" />
<Checkbox label="Push notifications" defaultChecked />

Indeterminate

<Checkbox label="Select all" checked="indeterminate" />

Disabled

<Checkbox label="Off & disabled" disabled />
<Checkbox label="On & disabled" checked disabled />

API Reference

Props of the Checkbox component.

PropTypeDefaultDescription
checkedboolean | 'indeterminate'
defaultCheckedboolean
onCheckedChange(checked: boolean | 'indeterminate') => void
labelstringRenders the label inline next to the checkbox.
descriptionstringHelper text below the label.
disabledbooleanfalse