Checkbox
inputsA control that allows the user to toggle between checked and not checked.
Preview
Installation
npm install @launchapp/design-systemImport
import { Checkbox } from "@launchapp/design-system";Examples
Basic Checkbox
<div className="flex items-center space-x-2"> <Checkbox id="terms" /> <label htmlFor="terms" className="text-sm font-medium"> Accept terms and conditions </label></div>Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | 'indeterminate' | — | The controlled checked state. |
defaultChecked | boolean | false | Initial checked state when uncontrolled. |
onCheckedChange | (checked: boolean | 'indeterminate') => void | — | Callback when checked state changes. |
disabled | boolean | false | Prevents user interaction. |
required | boolean | — | Makes the checkbox required in forms. |
name | string | — | Form field name. |