BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/basecn/checkbox

Checkbox

basecn/checkbox
FreeComponent

A control that allows the user to toggle between checked and not checked.

Live preview

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

Install it

npx shadcn@latest add https://basecn.dev/r/checkbox.json

Source

src/registry/components/ui/checkbox.tsxbasecn.dev/r/checkbox.json
1import * as React from "react";
2import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
3import { CheckIcon } from "lucide-react";
4
5import { cn } from "@/lib/utils";
6
7function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
8 return (
9 <CheckboxPrimitive.Root
10 data-slot="checkbox"
11 className={cn(
12 "peer border-input dark:bg-input/30 data-[checked]:bg-primary data-[checked]:text-primary-foreground dark:data-[checked]:bg-primary data-[checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
13 className
14 )}
15 {...props}
16 >
17 <CheckboxPrimitive.Indicator
18 data-slot="checkbox-indicator"
19 className="size-full flex items-center justify-center text-current transition-none"
20 >
21 <CheckIcon className="size-3.5" />
22 </CheckboxPrimitive.Indicator>
23 </CheckboxPrimitive.Root>
24 );
25}
26
27export { Checkbox };

What it pulls in

npm packages

  • @base-ui/react
  • lucide-react

Files it writes

  • src/registry/components/ui/checkbox.tsx

Facts

Registry
basecn
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on basecn basecn.dev akash3444/basecn on GitHub Raw registry item This item as JSON

More from basecn

All 56 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionbasecnComponentsFree2 deps
AlertalertbasecnComponentsFree1 dep
Alert Dialogalert-dialogbasecnComponentsFree1 dep
Aspect Ratioaspect-ratiobasecnComponentsFreeno deps
AutocompleteautocompletebasecnComponentsFree2 deps
AvataravatarbasecnComponentsFree1 dep
BadgebadgebasecnComponentsFree2 deps
BreadcrumbbreadcrumbbasecnComponentsFree2 deps
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