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.
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
Installation
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.
Related
- Textarea with Helper TextA textarea with helper text under it that
- Textarea with LabelA textarea with a visible label above it
- Textarea with Description FieldA feedback textarea with a description
- Textarea with Helper Text Above FieldA description textarea with a Markdown
- Textarea with Floating LabelA textarea whose label sits inside it
- Textarea with Inline LabelA three-row textarea with its label