checkbox
9ui/checkboxFreeComponent
9ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by 9ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://9ui.dev/r/checkbox.jsonSource
1"use client"23import * as React from "react"4import { Checkbox as BaseCheckbox } from "@base-ui/react/checkbox"5import { CheckIcon, MinusIcon } from "lucide-react"67import { cn } from "@/lib/utils"89function Checkbox({10 className,11 ...props12}: React.ComponentProps<typeof BaseCheckbox.Root>) {13 return (14 <BaseCheckbox.Root15 data-slot="checkbox"16 className={cn(17 "bg-input focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:text-destructive aria-invalid:focus:ring-destructive/50 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground data-indeterminate:text-foreground hover:border-ring/70 flex size-4 items-center justify-center rounded-[4px] border transition-[color,box-shadow,border-color] outline-none focus-visible:ring-[3px] data-disabled:pointer-events-none data-disabled:opacity-50",18 className19 )}20 {...props}21 >22 <BaseCheckbox.Indicator23 data-slot="checkbox-indicator"24 className="block data-unchecked:hidden"25 >26 {props.indeterminate ? (27 <MinusIcon className="size-3.5" />28 ) : (29 <CheckIcon className="size-3.5" />30 )}31 </BaseCheckbox.Indicator>32 </BaseCheckbox.Root>33 )34}3536export { Checkbox }
Files it writes
More from 9ui
All 56 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | 9ui | Components | Free | no deps | |
| alertalert | 9ui | Components | Free | no deps | |
| alert-dialogalert-dialog | 9ui | Components | Free | no deps | |
| aspect-ratioaspect-ratio | 9ui | Components | Free | no deps | |
| autocompleteautocomplete | 9ui | Components | Free | no deps | |
| avataravatar | 9ui | Components | Free | no deps | |
| badgebadge | 9ui | Components | Free | no deps | |
| breadcrumbsbreadcrumbs | 9ui | Components | Free | no deps |
