Copy to clipboard
Installation
Copy to clipboard
npx bearnie add checkbox
npx bearnie add checkbox
bunx bearnie add checkbox
bunx bearnie add checkbox
pnpm dlx bearnie add checkbox
pnpm dlx bearnie add checkbox
yarn dlx bearnie add checkbox
yarn dlx bearnie add checkbox
Copy to clipboard
import Checkbox from "@/components/ui/checkbox/Checkbox.astro";
import Label from "@/components/ui/label/Label.astro";
Usage
import { Checkbox } from "@/components/ui/checkbox"
<Checkbox id="terms" />
Examples
Checked
Copy to clipboard
Disabled
Copy to clipboard
With description
Copy to clipboard
Receive emails about new products and features.
Anatomy
Checkbox- A single form input element
Props
Checkbox
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | - | Element ID for label association |
| name | string | - | Form field name |
| checked | boolean | false | Default checked state |
| disabled | boolean | false | Disables the checkbox |
| required | boolean | false | Makes the field required |
| value | string | - | Form value when checked |
| class | string | - | Additional CSS classes |