MCPcopy Create free account
hub / github.com/bernaferrari/FigmaToCode / Checkbox

Function Checkbox

packages/plugin-ui/src/components/ui/checkbox.tsx:6–24  ·  view source on GitHub ↗
({ className, ...props }: CheckboxPrimitive.Root.Props)

Source from the content-addressed store, hash-verified

4import { cn } from "../../lib/utils";
5
6function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
7 return (
8 <CheckboxPrimitive.Root
9 data-slot="checkbox"
10 className={cn(
11 "peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
12 className,
13 )}
14 {...props}
15 >
16 <CheckboxPrimitive.Indicator
17 data-slot="checkbox-indicator"
18 className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
19 >
20 <CheckIcon />
21 </CheckboxPrimitive.Indicator>
22 </CheckboxPrimitive.Root>
23 );
24}
25
26export { Checkbox };

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected