A textarea that auto-grows as you type and stops at a maximum height, then scrolls. Use it wherever a fixed-height box is wrong: a chat, message, or AI prompt composer, a comment/reply/review box, a commit or PR description, a bio, note, changelog, or feedback field — anywhere a one-line input is too small but a tall empty box wastes the page. Common asks it answers: "auto resize textarea", "auto-growing / expanding textarea", "textarea that grows with content", "chat input that expands", "textarea min rows max rows", "react-textarea-autosize alternative". shadcn/ui's own textarea is a fixed-height styled element with a drag handle — this replaces that behaviour: minRows sets the collapsed height, maxRows caps the growth before it starts scrolling, and the height is measured from the element's real computed line-height, padding, and box-sizing, so it stays correct with your own font size, custom padding, or a className override. It also re-measures whenever the field's own width changes — a window resize, but equally a collapsing sidebar, an opening panel, or a tab becoming visible, none of which resize the window — and renders at roughly the right height before hydration via the rows attribute, so there is no first-paint jump. Keeps the native <textarea> element and forwards a ref to it, so labels, placeholders, form libraries (react-hook-form), and validation all work unchanged; styled with shadcn tokens (border-input, ring, muted-foreground) for automatic light/dark theming, and ships with zero dependencies beyond your cn util.
Provided by pulld
Install directly from the provider.
Light Mode
Dark Mode
Theme
CSS
No CSS found.