Checkbox

Form

A checkbox component that allows users to select multiple options from a list. Includes support for indeterminate state and custom styling.

Installation

bash
1npx @dinachi/cli@latest add checkbox

Run the CLI command above to automatically install the component and its dependencies.

Examples

Default Checkbox

A basic checkbox with label

Checkbox States

Different checkbox states including indeterminate

API Reference

PropTypeDefaultDescription
checked
boolean | 'indeterminate'The checked state of the checkbox
defaultChecked
booleanfalseThe default checked state
onCheckedChange
(checked: boolean | 'indeterminate') => voidCallback fired when the checked state changes
disabled
booleanfalseWhether the checkbox is disabled
required
booleanfalseWhether the checkbox is required