Checkbox
interlace-ui/checkboxFreeComponent
Tri-state boolean form control (checked / unchecked / indeterminate). Built on @base-ui/react/checkbox: Base UI owns `role="checkbox"`, `aria-checked="mixed"`, Space activation, and the controlled/uncontrolled pair (`checked` + `onCheckedChange` /…
Install it
npx shadcn@latest add https://ds.interlace.tools/r/checkbox.jsonSource
1'use client';23import * as React from 'react';45// @interlace/checkbox v1.1.0 — Interlace design system.6// Docs, props and live preview: https://ds.interlace.tools/c/checkbox7// What changed since: https://ds.interlace.tools/c/checkbox#history8// Generated banner — keep it, the upgrade diff reads this version.910/**11 * @interlace/ui — Checkbox12 *13 * Tri-state boolean form control (checked / unchecked / indeterminate).14 * Built on @base-ui/react/checkbox: Base UI owns `role="checkbox"`,15 * `aria-checked="mixed"`, Space activation, and the controlled/uncontrolled16 * pair (`checked` + `onCheckedChange` / `defaultChecked`).17 * Mirrors: https://base-ui.com/react/components/checkbox18 *19 * ## Anatomy20 *21 * Checkbox (Root) (button[role=checkbox] — data-min-viewport=320)22 * └─ CheckboxIndicator (Check / Minus glyph)23 *24 * ## MIN_VIEWPORT — 32025 *26 * ## Target size (SC 2.5.8, AA)27 *28 * The painted box is 16×16 CSS px. Rather than lean on the spacing29 * exception (a 24px circle must not intersect a neighbour's — true only30 * while callers keep ≥8px gaps, which the DS cannot enforce at the call31 * site), a transparent `before:` pseudo-element extends the hit area to32 * 24×24. Visual unchanged; the target genuinely measures 24px.33 *34 * ## Contrast (verified by token math)35 *36 * | Composite | Light | Dark | Floor |37 * | -------------------------------------------------- | ------ | ------- | --------------- |38 * | unchecked `border-input` on `--background` | 3.62:1 | 3.35:1 | 3:1 (SC 1.4.11) |39 * | checked `bg-primary` on `--background` | 8.80:1 | 11.79:1 | 3:1 (SC 1.4.11) |40 * | indeterminate `bg-primary` on `--background` | 8.80:1 | 11.79:1 | 3:1 (SC 1.4.11) |41 * | glyph `text-primary-foreground` on `bg-primary` | 8.80:1 | 11.79:1 | 3:1 (SC 1.4.11) |42 * | `aria-invalid:border-destructive` on `--background`| 8.31:1 | 10.43:1 | 3:1 (SC 1.4.11) |43 * | `focus-visible:ring-ring/60` on `--background` | 3.23:1 | 4.73:1 | 3:1 (SC 2.4.13) |44 *45 * `disabled:opacity-50` is exempt — SC 1.4.11 carves out inactive46 * user-interface components.47 *48 * ## API parity49 *50 * `rounded-[4px]` is an arbitrary radius: the DS radius scale starts at51 * `--interlace-radius-sm` = 8px, which fully rounds a 16px box into a52 * squircle. Kept for shadcn parity until the scale grows an `xs` step.53 *54// … truncated
More from interlace-ui
All 140 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| A11y Startera11y-starter | interlace-ui | Components | Free | no deps | |
| Accordionaccordion | interlace-ui | Components | Free | no deps | |
| Alertalert | interlace-ui | Components | Free | no deps | |
| Alert Dialogalert-dialog | interlace-ui | Components | Free | no deps | |
| Animated Gradient Textanimated-gradient-text | interlace-ui | Components | Free | no deps | |
| Animated Grid Patternanimated-grid-pattern | interlace-ui | Components | Free | no deps | |
| Animated Listanimated-list | interlace-ui | Components | Free | no deps | |
| Article Cardarticle-card | interlace-ui | Components | Free | no deps |
