DS0
Components

Checkbox

A toggle control that allows the user to select or deselect an option.

Overview

Checkbox is a toggle control for selecting or deselecting options. It supports controlled/uncontrolled state, indeterminate (partial) state, and integrates with the Label component.

Usage


export function Example() {
  return <Checkbox label="Accept terms and conditions" />;
}

States

<Checkbox label="Default" />
<Checkbox label="Checked" defaultChecked />
<Checkbox label="Indeterminate" indeterminate />
<Checkbox label="Disabled" isDisabled />
<Checkbox label="Required" isRequired />

With Description

<Checkbox label="Marketing emails" description="Receive updates about new features" />

API Reference

PropTypeDefaultDescription
labelstringLabel text (required)
checkedbooleanControlled checked state
defaultCheckedbooleanfalseUncontrolled default
onCheckedChange(checked: boolean | 'indeterminate') => voidChange handler
indeterminatebooleanfalseIndeterminate state
size'sm' | 'md' | 'lg''md'Checkbox size
ComponentWhen to Use Instead
SwitchImmediate on/off toggle
RadioGroupSingle selection from mutually exclusive options

On this page