viberss

RSS feed aggregator with a vibecoded reader app.
git clone https://unitehenry.com/git/viberss.git
Log | Files | Refs | README

checkbox.tsx (1378B)


      1 import * as React from "react"
      2 import { Checkbox as CheckboxPrimitive } from "radix-ui"
      3 
      4 import { cn } from "@/lib/utils"
      5 import { CheckIcon } from "lucide-react"
      6 
      7 function Checkbox({
      8   className,
      9   ...props
     10 }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
     11   return (
     12     <CheckboxPrimitive.Root
     13       data-slot="checkbox"
     14       className={cn(
     15         "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",
     16         className
     17       )}
     18       {...props}
     19     >
     20       <CheckboxPrimitive.Indicator
     21         data-slot="checkbox-indicator"
     22         className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
     23       >
     24         <CheckIcon />
     25       </CheckboxPrimitive.Indicator>
     26     </CheckboxPrimitive.Root>
     27   )
     28 }
     29 
     30 export { Checkbox }