label.tsx 599 B

12345678910111213141516171819202122
  1. import * as React from "react";
  2. import { Label as LabelPrimitive } from "radix-ui";
  3. import { cn } from "../lib/utils";
  4. function Label({
  5. className,
  6. ...props
  7. }: React.ComponentProps<typeof LabelPrimitive.Root>) {
  8. return (
  9. <LabelPrimitive.Root
  10. data-slot="label"
  11. className={cn(
  12. "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
  13. className,
  14. )}
  15. {...props}
  16. />
  17. );
  18. }
  19. export { Label };