Checkbox
boldkit/checkboxFreeComponent
A control that allows the user to toggle between checked and not checked
Live preview
live · rendered by the registry
Rendered by boldkit on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://boldkit.dev/r/checkbox.jsonSource
1import * as React from 'react'2import * as CheckboxPrimitive from '@radix-ui/react-checkbox'3import { Check } from 'lucide-react'4import { cn } from '@/lib/utils'56const Checkbox = React.forwardRef<7 React.ElementRef<typeof CheckboxPrimitive.Root>,8 React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>9>(({ className, ...props }, ref) => (10 <CheckboxPrimitive.Root11 ref={ref}12 className={cn(13 'peer h-5 w-5 shrink-0 border-3 border-foreground bg-background shadow-[4px_4px_0px_hsl(var(--shadow-color))] transition duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground hover:translate-x-[4px] hover:translate-y-[4px] hover:shadow-none active:translate-x-[4px] active:translate-y-[4px] active:shadow-none',14 className15 )}16 {...props}17 >18 <CheckboxPrimitive.Indicator19 className={cn('flex items-center justify-center text-current')}20 >21 <Check className="h-4 w-4 stroke-[3]" />22 </CheckboxPrimitive.Indicator>23 </CheckboxPrimitive.Root>24))25Checkbox.displayName = CheckboxPrimitive.Root.displayName2627export { Checkbox }
What it pulls in
npm packages
Other registry items
Files it writes
More from boldkit
All 94 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | boldkit | Components | Free | 2 deps | |
| Alertalert | boldkit | Components | Free | 2 deps | |
| Alert Dialogalert-dialog | boldkit | Components | Free | 1 dep | |
| ASCII Shapesascii-shapes | boldkit | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | boldkit | Components | Free | 1 dep | |
| Avataravatar | boldkit | Components | Free | 1 dep | |
| Badgebadge | boldkit | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | boldkit | Components | Free | 2 deps |
