checkbox
shipbase-ui/checkboxFreeComponent
shipbase/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/shipbase/ui/next/apps/www/public/r/react/checkbox.jsonSource
1"use client"23import * as React from "react"45import { Checkbox as CheckboxPrimitive } from "@ark-ui/react/checkbox"6import { CheckIcon, MinusIcon } from "lucide-react"78import { cn } from "@/lib/utils"910const Checkbox = CheckboxPrimitive.Root1112const CheckboxContext = CheckboxPrimitive.Context1314const CheckboxControl = React.forwardRef<15 React.ElementRef<typeof CheckboxPrimitive.Control>,16 CheckboxPrimitive.ControlProps17>(({ className, children, ...props }, ref) => (18 <>19 <CheckboxPrimitive.Control20 ref={ref}21 className={cn(22 "peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-500 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:aria-invalid:ring-destructive/40",23 className24 )}25 {...props}26 >27 <CheckboxPrimitive.Indicator28 className="grid place-content-center text-current"29 indeterminate30 >31 <MinusIcon className="size-4" />32 </CheckboxPrimitive.Indicator>33 <CheckboxPrimitive.Indicator className="grid place-content-center text-current">34 <CheckIcon className="size-4" />35 </CheckboxPrimitive.Indicator>36 </CheckboxPrimitive.Control>37 <CheckboxPrimitive.HiddenInput />38 </>39))40CheckboxControl.displayName = "CheckboxControl"4142const CheckboxGroup = CheckboxPrimitive.Group4344const CheckboxLabel = React.forwardRef<45 React.ElementRef<typeof CheckboxPrimitive.Label>,46 CheckboxPrimitive.LabelProps47>(({ className, ...props }, ref) => (48 <CheckboxPrimitive.Label49 ref={ref}50 className={cn(51 "select-none font-medium text-foreground text-sm leading-4 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",52 className53 )}54 {...props}55 />56))57CheckboxLabel.displayName = "CheckboxLabel"5859export {60 Checkbox,61 CheckboxContext,62 CheckboxControl,63 CheckboxGroup,64 CheckboxLabel,65}
What it pulls in
npm packages
Files it writes
More from shipbase/ui
All 32 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shipbase/ui | Components | Free | 2 deps | |
| avataravatar | shipbase/ui | Components | Free | 1 dep | |
| badgebadge | shipbase/ui | Components | Free | 2 deps | |
| buttonbutton | shipbase/ui | Components | Free | 2 deps | |
| cardcard | shipbase/ui | Components | Free | 1 dep | |
| collapsiblecollapsible | shipbase/ui | Components | Free | 1 dep | |
| comboboxcombobox | shipbase/ui | Components | Free | 2 deps | |
| dialogdialog | shipbase/ui | Components | Free | 2 deps |
