Textarea
A multi-line text field for longer answers.
- Status
- ReadyBuild day 15 of 21
- Code
- In React
- Role
- Form
Usage
This demo is live, and the code below it is the same code, imports included. The component lives in src/ui of this repository and is not published to npm yet.
Pastes as editable layers. Shadows are not exported.
import { useState, type ChangeEvent } from "react";
import { Textarea } from "@/ui";
export default function TextareaDemo() {
const [note, setNote] = useState<string>("");
return (
<Textarea
label="Approval notes"
placeholder="Write a note…"
maxLength={500}
value={note}
onChange={(e: ChangeEvent<HTMLTextAreaElement>) => setNote(e.target.value)}
/>
);
}Variants and states
Every specimen is the real component from src/ui, held in one state.
Pastes as editable layers. Shadows are not exported.
Props
- label
- string · default none
- Required.
- hint
- string · default none
- Helper text.
- error
- string · default none
- Marks the field invalid and replaces the hint.
- size
- "sm" | "md" | "lg" · default "md"
- Height 64, 88, 120.
- showCounter
- boolean · default true
- Shows used/max. Needs maxLength.
- ...rest
- TextareaHTMLAttributes · default none
- value, onChange, maxLength, placeholder, disabled, and so on.
Figma to code
Figma properties by their exact names from Naming, and the React prop that carries each one. The table covers the shared properties that bear on this component; the Figma file decides which of them its component exposes. None means there is no prop for it yet.
- 📐 Size
- size
- sm, md, or lg.
- 🎯 State
- value, error, disabled
- Hover and focus come from the browser.
- Show Label, Label
- label
- Always shown in code.
- Show Helper Text, Helper Text
- hint
- Pass to show.
- Placeholder
- placeholder
- Native.
- Show Counter
- showCounter
- Needs maxLength.
Accessibility
What the code in src/ui does today, and what it leaves to you.
Keyboard
- A native textarea.
Screen readers
- Label linked with for. The hint, error and counter are linked with aria-describedby.
What you still need to do
- maxLength stops typing at the limit; say the limit in the hint so it is not a surprise.
When to use
Notes, descriptions, and messages.
Do and don't
Do
- Size it to the expected length of the answer.
- Show a character count when there is a limit.
Don't
- Use for single-line answers.
- Disable resizing without a reason.
Related
4 of 16 other atoms, same role and ready ones first.
- CheckboxLets users select one or more options from a set.Ready
- OTP InputBoxes for entering a one-time code sent by SMS or email.Ready
- PIN InputMasked boxes for entering a secret PIN.Ready
- Radio ButtonA single option that belongs to a set where only one can be chosen.Ready
Status reflects the component tracker snapshot of 29 October 2026.