Checkbox
Checkbox is a component component that provides checkbox functionality.
Active
Examples
size
Different size options for the Checkbox component.
default
sm
lg
Installation
npm install @your-design-system/checkboximport { Checkbox } from "@/components/ui/checkbox"
import { Label } from "@/components/ui/label"
export function CheckboxDemo() {
return (
<div className="flex items-center space-x-2">
<Checkbox id="terms" />
<Label
htmlFor="terms"
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
>
Accept terms and conditions
</Label>
</div>
)
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | false | The checked prop for the component. |
disabled | boolean | false | Whether the component is disabled. |
id | string | - | The id prop for the component. |
name | string | - | The name prop for the component. |
value | string | - | The value prop for the component. |
onCheckedChange | string | - | The onCheckedChange prop for the component. |
Styling
The component uses Tailwind CSS classes for styling. You can customize the appearance by overriding these classes.
Base Classes
size Variants
default
h-4w-4sm
h-3w-3lg
h-5w-5Design System Compliance
This component is validated against atomic design principles and foundation token usage.
✓ Atomic Design Compliant
This component follows atomic design principles and properly uses foundation tokens.
On This Page