CoolFace
Apppublic

Leon4gr45/builder

sourceHugging Facemitupdated 2d agoView on Hugging Face
0likes
checkbox.tsx31 linesDownload Raw Back to ui
1"use client"2 3import * as React from "react"4import * as CheckboxPrimitive from "@radix-ui/react-checkbox"5import { Check } from "lucide-react"6 7import { cn } from "@/lib/utils"8 9const Checkbox = React.forwardRef<10  React.ElementRef<typeof CheckboxPrimitive.Root>,11  React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>12>(({ className, ...props }, ref) => (13  <CheckboxPrimitive.Root14    ref={ref}15    className={cn(16      "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",17      className18    )}19    {...props}20  >21    <CheckboxPrimitive.Indicator22      className={cn("flex items-center justify-center text-current")}23    >24      <Check className="h-4 w-4" />25    </CheckboxPrimitive.Indicator>26  </CheckboxPrimitive.Root>27))28Checkbox.displayName = CheckboxPrimitive.Root.displayName29 30export { Checkbox }31