Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input OTP
- Input Group
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Message Scroller
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
- New Component
Elements
Charts
Icons
import { Checkbox } from "@/components/ui/checkbox";
export const CheckboxDemo = () => (
<div className="flex items-center gap-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>
);States
Checked
Unchecked
Disabled
With Description
Pair the checkbox with a description label for more context.
Receive emails about new products and features.
Group
Use multiple checkboxes for multi-select lists.
Props
Checkbox
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | "indeterminate" | — | Controlled checked state |
defaultChecked | boolean | — | Initial checked state (uncontrolled) |
onCheckedChange | (checked: boolean | "indeterminate") => void | — | Callback when state changes |
disabled | boolean | false | Prevents interaction |
required | boolean | false | Marks the field as required |
name | string | — | Form field name |
value | string | "on" | Form field value when checked |
className | string | — | Additional CSS classes |
Usage
import { Checkbox } from "@/components/ui/checkbox";
// With label
<div className="flex items-center gap-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>
// Controlled
const [checked, setChecked] = useState(false);
<Checkbox
checked={checked}
onCheckedChange={setChecked}
/>
// Indeterminate (e.g. select-all pattern)
<Checkbox checked="indeterminate" />
// In a form
<Checkbox id="marketing" name="marketing" value="yes" />Specs
# Mint — Checkbox Specs
## Component
- name: checkbox
- file: registry/mint/checkbox.tsx
- installs to: components/ui/checkbox.tsx
- dependencies: radix-ui, lucide-react
## What is it
A binary toggle input for forms and settings. Supports three states:
unchecked, checked, and indeterminate (for select-all patterns). Uses
Radix UI's Checkbox primitive for accessible keyboard and screen reader
support. Renders a Check icon (stroke-[3]) when checked.
## Visual identity
Small (size-4 / 16px), square with rounded-[4px] corners — not fully
rounded. Thin border (border-input) in rest state, filled primary on
checked. Clean and dense — designed to sit in lists and forms without
visual weight.
## Design tokens
--input: oklch(0.88 0.04 155 / 60%) — unchecked border
--primary: oklch(0.5 0.14 155) — checked background + border
--primary-foreground: oklch(1 0 0) — check icon color
--ring: oklch(0.5 0.14 155) — focus ring
--destructive: oklch(0.55 0.25 15) — aria-invalid border
## Dark theme
--input: oklch(0.32 0.05 155 / 40%)
--primary: oklch(0.62 0.15 155)
--primary-foreground: oklch(0.1 0 0)
## States
- unchecked: border-input, transparent background
- checked: bg-primary text-primary-foreground border-primary
- indeterminate: bg-primary text-primary-foreground border-primary
- focus-visible: border-ring + ring-ring/50 + ring-[3px]
- disabled: opacity-50 cursor-not-allowed (via peer, label follows)
- aria-invalid: border-destructive + ring-destructive/20
## Label pattern
Always use a <label> with matching htmlFor. Apply peer-disabled classes
on the label to visually sync disabled state:
className="peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
## Conventions
- Always pair with a <label htmlFor="..."> for accessibility
- Use mt-0.5 on Checkbox when pairing with multi-line description text
- For select-all: set checked="indeterminate" and handle onCheckedChange
- In React Hook Form: use <Controller> with onCheckedChange={field.onChange}
- Do not use Checkbox for mutually exclusive choices — use RadioGroup insteadInstallation
$ npx shadcn add \https://gin-design.vercel.app/checkbox