Checkbox

A controlled and uncontrolled checkbox with support for sizes and disabled state.

Default

An uncontrolled checkbox with no initial value.

<Checkbox />

Checked

Use defaultChecked to set the initial checked state in uncontrolled mode.

<Checkbox defaultChecked />

Sizes

Use the size prop to control the checkbox dimensions. The default size is md.

<Checkbox size="sm" />
<Checkbox size="md" />

Disabled

Pass the disabled prop to prevent interaction.

<Checkbox disabled />
<Checkbox defaultChecked disabled />

Props

PropTypeDefaultDescription
checkedbooleanControlled checked state
defaultCheckedbooleanfalseInitial uncontrolled state
onCheckedChange(checked: boolean) => voidCalled when value changes
size'sm' | 'md''md'Controls dimensions
disabledbooleanfalsePrevents interaction
classNamestring''Additional Tailwind classes