BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-htmx/checkbox

Checkbox

shadcn-htmx/checkbox
FreeComponent

Native <input type="checkbox"> with shadcn polish — peer-checked SVG indicator, indeterminate support, htmx-ready.

Live preview

live · rendered by the registry
Rendered by shadcn-htmx on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://shadcn-htmx.productdevbook.com/r/checkbox.json

Source

registry/ui/checkbox.tsxshadcn-htmx.productdevbook.com/r/checkbox.json · first 6 KB
1/** @jsxImportSource hono/jsx */
2import { cn, type ClassValue } from "@/registry/lib/cn"
3
4// Native <input type="checkbox"> with shadcn polish. Source of truth:
5// repos/shadcn-ui/apps/v4/registry/new-york-v4/ui/checkbox.tsx
6//
7// The upstream shadcn uses Radix Checkbox, which renders a styled div with
8// role="checkbox" and hides the native input. We can't depend on Radix in
9// our SSR setup, so we keep a real <input type="checkbox"> (form-submittable,
10// keyboard-accessible, accessible-name aware) and layer a check icon on top.
11//
12// Pairing with a Label: use the htmlFor pattern — clicking the label toggles
13// the checkbox. Indeterminate state must be set via JS (the HTML attribute
14// alone won't do it); we mirror the data-state attribute on the wrapper so
15// custom styling can react.
16
17const inputBase =
18 "peer size-4 shrink-0 appearance-none rounded-[4px] border border-input bg-background shadow-xs transition-shadow outline-none " +
19 "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 " +
20 "disabled:cursor-not-allowed disabled:opacity-50 " +
21 "checked:border-primary checked:bg-primary " +
22 "indeterminate:border-primary indeterminate:bg-primary " +
23 "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 " +
24 "dark:bg-input/30"
25
26export function checkboxClasses(opts?: { class?: ClassValue }): string {
27 return cn(inputBase, opts?.class)
28}
29
30type CheckboxProps = {
31 id?: string
32 name?: string
33 value?: string
34 checked?: boolean
35 defaultChecked?: boolean
36 // Render the SSR hook for an initially-indeterminate checkbox. `indeterminate`
37 // is an IDL-only property with no HTML content attribute (WHATWG HTML: it is
38 // initially false and "cannot be set using an HTML attribute"), so an SSR
39 // component emits data-initial-indeterminate="true" and a tiny on-mount
40 // script flips el.indeterminate. See repos/whatwg-html/source (indeterminate
41 // IDL attribute) and the input/checkbox MDN reference.
42 indeterminate?: boolean
43 required?: boolean
44 disabled?: boolean
45 readonly?: boolean
46 form?: string
47 class?: ClassValue
48 ariaLabel?: string
49 ariaLabelledby?: string
50 ariaDescribedby?: string
51 ariaInvalid?: boolean
52 // ID of a visible element containing an error message. Pair with
53 // ariaInvalid for the full WCAG error-identification pattern.
54 // See repos/mdn/files/en-us/web/accessibility/aria/reference/attributes/aria-errormessage/index.md
55// … truncated

Facts

Registry
shadcn-htmx
Type
registry:ui
Access
Free
Files written
0
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
yesterday

Go to the source

Docs on shadcn-htmx shadcn-htmx.productdevbook.com productdevbook/shadcn-htmx on GitHub Raw registry item This item as JSON

More from shadcn-htmx

All 83 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionshadcn-htmxComponentsFreeno deps
Active Searchactive-searchshadcn-htmxComponentsFreeno deps
Alertalertshadcn-htmxComponentsFreeno deps
Alert Dialogalert-dialogshadcn-htmxComponentsFreeno deps
Aspect Ratioaspect-ratioshadcn-htmxComponentsFreeno deps
Auto Gridauto-gridshadcn-htmxComponentsFreeno deps
Autocompleteautocompleteshadcn-htmxComponentsFreeno deps
Autosize Textareaautosize-textareashadcn-htmxComponentsFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex