Checkbox
thegridcn/checkboxFreeComponent
thegridcn publishes no description for this item.
See it running
Open the demo on thegridcn
thegridcn.com/r/checkboxInstall it
npx shadcn@latest add https://thegridcn.com/r/checkbox.jsonSource
1"use client"23import * as React from "react"4import * as CheckboxPrimitive from "@radix-ui/react-checkbox"5import { CheckIcon } from "lucide-react"67import { cn } from "@/lib/utils"89function Checkbox({10 className,11 ...props12}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {13 return (14 <CheckboxPrimitive.Root15 data-slot="checkbox"16 className={cn(17 "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=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",18 className19 )}20 {...props}21 >22 <CheckboxPrimitive.Indicator23 data-slot="checkbox-indicator"24 className="grid place-content-center text-current transition-none"25 >26 <CheckIcon className="size-3.5" />27 </CheckboxPrimitive.Indicator>28 </CheckboxPrimitive.Root>29 )30}3132export { Checkbox }
What it pulls in
npm packages
Files it writes
More from thegridcn
All 139 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | thegridcn | Components | Free | 2 deps | |
| Agent Avataragent-avatar | thegridcn | Components | Free | no deps | |
| Alertalert | thegridcn | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | thegridcn | Components | Free | 1 dep | |
| Announcement Barannouncement-bar | thegridcn | Components | Free | no deps | |
| Anomaly Banneranomaly-banner | thegridcn | Components | Free | no deps | |
| Arrival Panelarrival-panel | thegridcn | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | thegridcn | Components | Free | 1 dep |
