返回 presentation-ai
label.tsx
根目录 / src / components / ui / label.tsx
1 "use client";
2
3 import * as LabelPrimitive from "@radix-ui/react-label";
4 import { cva, type VariantProps } from "class-variance-authority";
5 import * as React from "react";
6
7 import { cn } from "@/lib/utils";
8
9 const labelVariants = cva(
10 "text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
11 );
12
13 const Label = React.forwardRef<
14 React.ElementRef<typeof LabelPrimitive.Root>,
15 React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
16 VariantProps<typeof labelVariants>
17 >(({ className, ...props }, ref) => (
18 <LabelPrimitive.Root
19 ref={ref}
20 className={cn(labelVariants(), className)}
21 {...props}
22 />
23 ));
24 Label.displayName = LabelPrimitive.Root.displayName;
25
26 export { Label };
27
27 lines Plain Text