Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

Label.tsx

25 lines571 Bytes

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