Checkbox
uiable/checkboxFreeComponent
Checkbox component.
Live preview
live · rendered by the registry
Rendered by uiable on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://uiable.com/r/checkbox.jsonSource
1"use client";23import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";45import { cn } from "@/lib/utils";6import { CheckIcon } from "lucide-react";78function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {9 return (10 <CheckboxPrimitive.Root11 data-slot="checkbox"12 className={cn(13 "border-border dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-[17.5px] shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",14 className15 )}16 {...props}17 >18 <CheckboxPrimitive.Indicator19 data-slot="checkbox-indicator"20 className="grid place-content-center text-current transition-none [&>svg]:size-3 [&>svg]:stroke-3"21 >22 <CheckIcon />23 </CheckboxPrimitive.Indicator>24 </CheckboxPrimitive.Root>25 );26}2728export { Checkbox };
What it pulls in
npm packages
Files it writes
More from uiable
All 712 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | uiable | Components | Free | 2 deps | |
| Alertalert | uiable | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | uiable | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | uiable | Components | Free | no deps | |
| Attachmentattachment | uiable | Components | Free | 2 deps | |
| Avataravatar | uiable | Components | Free | 1 dep | |
| Badgebadge | uiable | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | uiable | Components | Free | 2 deps |
