Checkbox
avail-widgets/checkboxFreeComponent
UI primitive: Checkbox
Install it
npx shadcn@latest add https://elements.nexus.availproject.org/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 outline-none ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 shrink-0 transition-colors",18 "w-[20px] h-[20px] rounded-[4px]",19 "data-[state=unchecked]:bg-[#FFFFFE] data-[state=unchecked]:border-[2px] data-[state=unchecked]:border-[#E8E8E7]",20 "data-[state=checked]:bg-[#006BF4] data-[state=checked]:border-transparent",21 className22 )}23 {...props}24 >25 <CheckboxPrimitive.Indicator26 data-slot="checkbox-indicator"27 className="flex items-center justify-center text-current w-full h-full"28 >29 <div className="w-[8px] h-[8px] rounded-[2px] bg-[#FFFFFE]" />30 </CheckboxPrimitive.Indicator>31 </CheckboxPrimitive.Root>32 )33}3435// Since absolute inline styles override tailwind data states, let's refine the component styling36// inside a style tag or purely via Tailwind arbitrarily extending the exact colors.3738export { Checkbox }
What it pulls in
npm packages
Other registry items
Files it writes
More from avail-widgets
All 27 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | avail-widgets | Components | Free | 2 deps | |
| All Elementsall | avail-widgets | Components | Free | no deps | |
| Animated Spinneranimated-spinner | avail-widgets | Components | Free | no deps | |
| Badgebadge | avail-widgets | Components | Free | 2 deps | |
| Bridge Depositbridge-deposit | avail-widgets | Components | Free | 3 deps · 32 files | |
| Buttonbutton | avail-widgets | Components | Free | 2 deps | |
| Cardcard | avail-widgets | Components | Free | no deps | |
| Collapsiblecollapsible | avail-widgets | Components | Free | 1 dep |
