label.tsx 609 B

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