textarea.tsx
644 bytes
| 1 | import * as React from 'react'; |
|---|---|
| 2 | import { cn } from '@/lib/utils'; |
| 3 | |
| 4 | const Textarea = React.forwardRef<HTMLTextAreaElement, React.TextareaHTMLAttributes<HTMLTextAreaElement>>( |
| 5 | ({ className, ...props }, ref) => ( |
| 6 | <textarea |
| 7 | className={cn( |
| 8 | 'flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', |
| 9 | className, |
| 10 | )} |
| 11 | ref={ref} |
| 12 | {...props} |
| 13 | /> |
| 14 | ), |
| 15 | ); |
| 16 | Textarea.displayName = 'Textarea'; |
| 17 | |
| 18 | export { Textarea }; |
| 19 | |