Checkbox
Checkbox input with label and custom styling.
Preview
Installation
npx drivn add checkboxUsage
1 import { Checkbox } from "@/components/ui/checkbox" 2 3 export default function Page() { 4 return <Checkbox label="Accept terms" /> 5 }
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Text label displayed next to the checkbox |
checked | boolean | false | Whether the checkbox is checked |
disabled | boolean | false | Disables the checkbox and prevents interaction |
onChange | (checked: boolean) => void | — | Callback fired when the checked state changes |
className | string | — | Additional CSS classes to apply to the checkbox wrapper |
...props | InputHTMLAttributes<HTMLInputElement> | — | All standard HTML input attributes are supported |