Skip to content
Drivn logoDrivn

Checkbox

Checkbox input with label and custom styling.

Preview

Installation

npx drivn add checkbox

Usage

1import { Checkbox } from "@/components/ui/checkbox"
2
3export default function Page() {
4 return <Checkbox label="Accept terms" />
5}

API Reference

PropTypeDefaultDescription
labelstringText label displayed next to the checkbox
checkedbooleanfalseWhether the checkbox is checked
disabledbooleanfalseDisables the checkbox and prevents interaction
onChange(checked: boolean) => voidCallback fired when the checked state changes
classNamestringAdditional CSS classes to apply to the checkbox wrapper
...propsInputHTMLAttributes<HTMLInputElement>All standard HTML input attributes are supported