Default
Grows with what you write. The resize handle in the corner is drawn by hand over the browser's own.
A multi-line text field on paper: a pencil box around a real <textarea> that grows with its text, with optional hand-ruled lines on the baselines, a drawn resize handle and a character counter.
npx shadcn@latest add @wobko/textareaFirst time here? Add the registry to components.json first. How to install
Grows with what you write. The resize handle in the corner is drawn by hand over the browser's own.
ruled draws pencil lines on the baselines of the text. The rules are re-pulled as the box grows, so they always end where the paper does.
showCount with maxLength; the second field turns red when it is too short. Disabled and read-only fields are drawn as such.
Label, Input and a ruled Textarea in a real form: the note is required, and the button says what happened.
Official `textarea-demo`: a bare textarea with a placeholder. It sits in a hand-drawn box that grows with its text (`field-sizing: content`, as upstream) and redraws the resize grip in its corner. Only addition: an `aria-label`, since there is no visible label.
Official `textarea-disabled`: the same field with `disabled`. The box is redrawn dashed in pencil gray, so the state does not rest on color alone.
Official `textarea-with-button`: the field stacked over a full-width Send button on a two-row grid. The gap is `gap-3` (the original's `gap-2` plus a pencil's width): a marker band bleeds a few pixels past its box, and a wide one would touch the field.
Official `textarea-with-label`: a Label tied to the field by `htmlFor` and `id`, so a click on the words puts the cursor in the box. The id is prefixed to stay unique on a page with other examples.
Official `textarea-with-text`: a label, the field and a line of help text below. The help is linked to the field with `aria-describedby` (the original leaves it unlinked), so a screen reader reads it with the field.
A <span data-slot="textarea-frame"> (the drawn box) around <textarea data-slot="textarea">. As with Input, every prop and ref go to the <textarea>; className and style go to the frame, and padding, resize-* and control variants (placeholder:, focus:, ...) are moved onto the textarea.
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Classes for the frame (width, min/max height, margins, font, text color). Padding, resize-*, field-sizing-* and control-only variants are applied to the <textarea>. |
| inputClassName | string | - | Classes appended to the <textarea> itself. |
| ruled | boolean | false | Hand-ruled paper: pencilled rules on the text's baselines. It fixes the rhythm (28 px lines, the first 8 px from the top, min height of three lines) and always grows with its text, so lines and text never drift apart. |
| autoGrow | boolean | true | Grow with the text using field-sizing: content, as upstream does. false keeps rows and a fixed height. |
| showCount | boolean | (info: { length: number; max?: number }) => ReactNode | false | A counter in the bottom corner (12 or 12/280 with maxLength), or your own render function. It is the field's aria-describedby, so a screen reader hears it on focus, not on every keystroke. |
| seed | string | number | - | Pins the hand: the same seed always draws the same box. Default: derived from useId(). |
| aria-invalid | boolean | "true" | "false" | - | true draws the red-pencil box, the wavy underline and a ! in the corner. |
| disabled / readOnly | boolean | - | Dashed pencil on a pale wash / a printed field. |
The files the CLI copies into your project.
Loading the source