Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Textarea examples · Labeled

Textarea with Description for React

A textarea with a description between its label and the field.

Framework
UI library

Some fields need a line of guidance before people start typing. Here the Field stacks a FieldLabel, a FieldDescription and the Textarea, so the description reads right after the label and before the field, in the muted text color.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

When should I add description text below the label?

When the label alone doesn't say enough: a format to follow, a limit, who will read it. If the description only repeats the label, such as Notes and Enter notes, drop it.

Why use text-muted-foreground for description text?

FieldDescription uses the muted color and a smaller size so the label stays the first thing people read and the description reads as supporting text. The muted token keeps enough contrast in both themes.

How much spacing should be between label and description?

Field spaces its children evenly, and a FieldDescription followed by one more child pulls itself up a little, so the label and description read as a pair with the field a step below. Change the gap on the Field if your form needs another rhythm.

How long should description text be?

One short sentence. For several rules, link to a help page or use a list, rather than a paragraph people will skip.

How do I show error messages with description text?

Keep the description and add a FieldError under the Textarea when the value is wrong, with the Field marked invalid. The guidance stays visible while people fix the error, and the border turns destructive.

Do screen readers announce description text?

They read it in order, between the label and the field. To have it announced when the Textarea gets focus, give the description an id and point the Textarea's aria-describedby at it.