label.tsx 530 B

12345678910111213141516171819202122
  1. import * as React from 'react';
  2. import { cn } from '@/lib/utils';
  3. export type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;
  4. const Label = React.forwardRef<HTMLLabelElement, LabelProps>(
  5. ({ className, ...props }, ref) => {
  6. return (
  7. <label
  8. ref={ref}
  9. className={cn(
  10. 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
  11. className
  12. )}
  13. {...props}
  14. />
  15. );
  16. }
  17. );
  18. Label.displayName = 'Label';
  19. export { Label };