Checkbox
Controlled or uncontrolled checkbox with optional label.
Installation
npx @obi/ui add checkboxPreview
Usage
import { Checkbox } from '@/src/components/Checkbox/Checkbox';
<Checkbox label="Accept terms" />
<Checkbox label="Checked" defaultChecked />
<Checkbox label="Disabled" disabled />Props
| Name | Type | Default | Description |
|---|---|---|---|
| label | string | undefined | Text label rendered next to the checkbox. |
| id | string | undefined | HTML id, links label to input. |
| checked | boolean | undefined | Controlled checked state. |
| disabled | boolean | false | Disables the checkbox. |
| onChange | ChangeEventHandler<HTMLInputElement> | undefined | Change event handler. |