Form
Textarea
A multi-line text field that grows with its content.
LiveRev. 01
It grows as you type.
Installation
CLI
$ npx shadcn@latest add https://konsa.rohitxyz.me/r/textarea.jsonManual
Copy the source into your project
components/ui/textarea.tsx
import * as React from "react";
import { cn } from "@/lib/utils";
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
return (
<textarea
data-slot="textarea"
className={cn(
"flex field-sizing-content min-h-20 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs transition-[border-color,box-shadow] outline-none placeholder:text-muted-foreground",
"focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/15",
"aria-invalid:border-destructive aria-invalid:ring-destructive/15",
"disabled:cursor-not-allowed disabled:opacity-50",
className,
)}
{...props}
/>
);
}
export { Textarea };Update the import paths to match your project
The file imports cn from @/lib/utils. See installation.
Usage
import { Textarea } from "@/components/ui/textarea";<Textarea placeholder="Write a message" />