BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/solid-ui/checkbox

Checkbox

solid-ui/checkbox
FreeComponent

A checkbox component

Live preview

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

Install it

npx shadcn@latest add https://www.solid-ui.com/r/checkbox.json

Source

src/registry/ui/checkbox.tsxwww.solid-ui.com/r/checkbox.json
1import type { ValidComponent } from "solid-js"
2import { Match, splitProps, Switch } from "solid-js"
3
4import * as CheckboxPrimitive from "@kobalte/core/checkbox"
5import type { PolymorphicProps } from "@kobalte/core/polymorphic"
6
7import { cn } from "~/lib/utils"
8
9type CheckboxRootProps<T extends ValidComponent = "div"> =
10 CheckboxPrimitive.CheckboxRootProps<T> & { class?: string | undefined }
11
12const Checkbox = <T extends ValidComponent = "div">(
13 props: PolymorphicProps<T, CheckboxRootProps<T>>
14) => {
15 const [local, others] = splitProps(props as CheckboxRootProps, ["class"])
16 return (
17 <CheckboxPrimitive.Root
18 class={cn("items-top group relative flex space-x-2", local.class)}
19 {...others}
20 >
21 <CheckboxPrimitive.Input class="peer" />
22 <CheckboxPrimitive.Control class="size-4 shrink-0 rounded-sm border border-primary ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2 data-[checked]:border-none data-[indeterminate]:border-none data-[checked]:bg-primary data-[indeterminate]:bg-primary data-[checked]:text-primary-foreground data-[indeterminate]:text-primary-foreground">
23 <CheckboxPrimitive.Indicator>
24 <Switch>
25 <Match when={!others.indeterminate}>
26 <svg
27 xmlns="http://www.w3.org/2000/svg"
28 viewBox="0 0 24 24"
29 fill="none"
30 stroke="currentColor"
31 stroke-width="2"
32 stroke-linecap="round"
33 stroke-linejoin="round"
34 class="size-4"
35 >
36 <path d="M5 12l5 5l10 -10" />
37 </svg>
38 </Match>
39 <Match when={others.indeterminate}>
40 <svg
41 xmlns="http://www.w3.org/2000/svg"
42 viewBox="0 0 24 24"
43 fill="none"
44 stroke="currentColor"
45 stroke-width="2"
46 stroke-linecap="round"
47 stroke-linejoin="round"
48 class="size-4"
49 >
50 <path d="M5 12l14 0" />
51 </svg>
52 </Match>
53 </Switch>
54 </CheckboxPrimitive.Indicator>
55 </CheckboxPrimitive.Control>
56 </CheckboxPrimitive.Root>
57 )
58}
59
60export { Checkbox }

What it pulls in

npm packages

  • solid-js
  • @kobalte/core

Files it writes

  • src/registry/ui/checkbox.tsx

Facts

Registry
solid-ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on solid-ui www.solid-ui.com stefan-karger/solid-ui on GitHub Raw registry item This item as JSON

More from solid-ui

All 55 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionsolid-uiComponentsFree2 deps
Alertalertsolid-uiComponentsFree3 deps
Alert Dialogalert-dialogsolid-uiComponentsFree2 deps
Aspect Ratioaspect-ratiosolid-uiComponentsFree1 dep
Avataravatarsolid-uiComponentsFree2 deps
Badgebadgesolid-uiComponentsFree2 deps
Badge Deltabadge-deltasolid-uiComponentsFree2 deps
Bar Listbar-listsolid-uiComponentsFree1 dep
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex