TextareaNew
A text box that eases to the height of what you write, scrolls with its own thin thumb and faded edges, and turns into a composer with tools, a send button and ⌘↵.
Used forComments and repliesBio and description fieldsFeedback formsRelease notes and changelogs
Install with the shadcn CLI
Older shadcn CLI, or a network that blocks ui.shadcn.com? Install by URL: shadcn add https://hairlineui.com/r/textarea.json. More
Used in 3 blocks
All blocks- BookingBook a call on one card: the time you pick prints onto the host’s ticket, then the times turn into your details and the confirmation.
- FeedbackA score that changes the question: pick 0–10 or stars, the score rolls into the panel, and the follow-up and its tags fit what you picked.
- SubscriptionA billing page in one card: the plan with a ring through its billing period, usage, card and invoices, and a cancel that offers a pause first.
Templates
Need the whole page?
65 Next.js landing pages, each designed from scratch. Try any of them live; one is $39, all of them $159, and 8 are free.
Where it’s used
Comments and replies
A reply box with send inside it, and ⌘↵.
Bio and description fields
A limit with a count that warns before it stops you.
Feedback forms
Long answers that scroll after a few lines instead of taking the page.
Release notes and changelogs
Writing in a card without a fixed height.
What it handles for you
Growing a textarea by resetting its height to auto flickers, and the native scrollbar breaks the shape of the field. A hidden mirror measures instead, and scrolling is drawn by the component.
Eased growth
The box eases to each new height in 260ms, between minRows and maxRows.
Scrolling that keeps the shape
No native scrollbar: a 3px thumb inside the padding and 14px edge fades, written to the elements with no render per scroll frame.
Composer mode
action (send) inside the box, footer for tools if you need them; onSubmit on ⌘↵ / Ctrl+Enter with a hint beside the action.
A count that rolls
Each digit rolls the way the count moved; amber in the last 10%, red at the limit.
No zoom on iPhone
16px text on phones, the designed size from the sm breakpoint.
Overview
Auto-growing textareas usually snap a line taller on every wrap, then show the browser's scrollbar, a grey bar that cuts through the rounded edge while lines are sliced flat at the top. This one measures a hidden copy of the text and eases the box to it between minRows and maxRows. Past that it scrolls with its own 3px thumb inside the padding (shown while scrolling, draggable), and lines fade out at the edges instead of being cut. Add `footer` and `action` and it becomes a reply composer: tools on the left, send on the right, ⌘↵ to send.
States
- rest
- minRows tall (3 by default) inside a 14px-radius hairline box.
- growing
- Each wrap eases the box to the mirror's height (260ms).
- scrolling
- Past maxRows: lines fade at the edges (14px), the thumb shows while scrolling and fades 0.9s after; drag it to scroll.
- ready to send
- With onSubmit and text, "⌘↵ to send" rises in beside the action.
- near limit
- With maxLength, the count turns amber at 90% and red at 100%.
- error
- Red line, the error replaces the hint, one shake.
Usage
Works with
Installs with it
Built on it
- BookingBook a call on one card: the time you pick prints onto the host’s ticket, then the times turn into your details and the confirmation.
- FeedbackA score that changes the question: pick 0–10 or stars, the score rolls into the panel, and the follow-up and its tags fit what you picked.
- SubscriptionA billing page in one card: the plan with a ring through its billing period, usage, card and invoices, and a cancel that offers a pause first.
Props
- minRows / maxRows= 3 / 10
- number
- Height range in lines; it scrolls past maxRows.
- footer
- ReactNode
- Tools inside the box on the left.
- action
- ReactNode
- The main action inside the box on the right.
- onSubmit
- (value: string) => void
- Called on ⌘↵ / Ctrl+Enter when there is text.
- maxLength
- number
- Limit; shows a rolling count beside the label.
- showCount= true
- boolean
- Show the count when maxLength is set.
- label / hint / error
- ReactNode
- As in Input.
- onValueChange
- (value: string) => void
- The new text on every change.
- ...textarea props
- TextareaHTMLAttributes
- Everything a native textarea takes, including ref.
Accessibility and motion
- Shares field.tsx with every text control: one surface, one focus ring, one way of showing hints and errors.
- The thumb is decorative (aria-hidden); the textarea still scrolls with wheel, touch and keys.
- Reduced motion: the height changes at once.
Requirements
React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.
The CLI also installs Number roll.
Source
Registry item: /r/textarea.json


