Checkbox

@sushindustries/ui

A native checkbox with its words attached, painted by accent-color rather than redrawn.

4 min read
View as MarkdownEdit on GitHub

Checkbox is a native <input type="checkbox"> with its label attached, painted in the site's accent color by accent-color rather than hidden and redrawn. Reach for it for any single yes/no or multi-select choice in a form.

Viewport width
Phone22remthe floor, the narrowest this promises to work at
tanstacktanstack add https://adamjurek.com/r/tanstack/checkbox.jsonshadcnpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/checkbox.json

Why it is built this way

One CSS property, accent-color, is the entire style layer. That keeps every native behaviour a hand-drawn checkbox has to rebuild - keyboard handling, form submission, the indeterminate state, screen-reader semantics - for the cost of a single declaration, and a custom-drawn replacement earns none of it back.

What it does not do

It does not render a custom checkmark or animate the check. The box is the browser's own, so its look is whatever accent-color and the platform agree on, not a shape pulled pixel for pixel from a mockup.

Install commands are not written here

Anything in packages/ui/registry.ts gets its TanStack and shadcn commands attached automatically, so there is nothing to keep in sync.

Install

tanstack add https://adamjurek.com/r/tanstack/checkbox.json
shell
pnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/checkbox.json
shell
pnpm add @sushindustries/ui @sushindustries/atoms
shell

What you get

Version0.1.0
Categorycontent · Forms
Filescheckbox.tsx
DependenciesNone
Tagsform, no-deps

No runtime dependencies

It brings nothing with it beyond the stylesheet.