Skip to content
GetUrUI

Textarea

New
.md

Multi-line field on the sunken well that grows with a spring between min and max rows, with a ring-gauge character counter, a resize handle and a toolbar slot.

textareaformauto-growcharacter countcommentmultiline

Installation

$npx shadcn@latest add @geturui/textarea
Download source (.zip)

Also installs: Field

Usage

usage.tsx
1import { Textarea } from "@/components/ui/textarea";
2
3export function ReleaseNotes() {
4  return (
5    <Textarea
6      label="Release notes"
7      hint="Grows as you type, up to eight lines."
8      maxLength={280}
9      minRows={3}
10      maxRows={8}
11      placeholder="What shipped this week?"
12    />
13  );
14}

Props

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"Text size and padding of the well.
label / hint / error / requiredReactNode / ReactNode / ReactNode / boolean—Field shell: label with required marker, helper line, error that shakes the well once.
autoGrowbooleantrueGrow with the content on a spring. Off keeps the height at minRows.
minRows / maxRowsnumber3 / 8Height range in lines; beyond maxRows the field scrolls.
maxLengthnumber—Native limit. Shows a counter with a ring gauge in the label row.
showCountbooleantrue with maxLengthHide or show the counter.
warnAtnumber0.8Fraction of maxLength where the counter turns to a warning; at the limit it turns danger and shakes once.
resizablebooleanfalseCorner handle to make the field taller by drag, or by arrow keys when focused.
toolbarReactNode—Row of controls inside the well under the text.
labelAsideReactNode—Extra text on the label row, beside the counter.
readOnly / disabledboolean—Read-only shows a dashed, flat well; disabled dims it.
value / defaultValue / onValueChangestring / string / (value: string) => void—Controlled or uncontrolled text. The native onChange still fires.

Accessibility

  • The label, hint or error and the character count are all linked to the textarea.
  • Crossing into the warning zone and reaching the limit are announced once each through a polite live region, not on every keystroke.
  • The resize handle is a focusable separator: ArrowUp and ArrowDown change the height by a line, Home resets it.
  • Height changes apply instantly under reduced motion, and the counter does not shake.

Related