label.tsx 589 B

12345678910111213141516171819202122232425
  1. "use client"
  2. import * as React from "react"
  3. import { cva, type VariantProps } from "class-variance-authority"
  4. import { cn } from "@/lib/utils/client"
  5. const labelVariants = cva(
  6. "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
  7. )
  8. const Label = React.forwardRef<
  9. HTMLLabelElement,
  10. React.ComponentPropsWithoutRef<"label"> &
  11. VariantProps<typeof labelVariants>
  12. >(({ className, ...props }, ref) => (
  13. <label
  14. ref={ref}
  15. className={cn(labelVariants(), className)}
  16. {...props}
  17. />
  18. ))
  19. Label.displayName = "Label"
  20. export { Label }