Live demo
Demo source
Use a textarea for text that may run over several lines, such as comments, a problem description or a delivery note. For a single short value, use a text field.
Anatomy
A textarea with three callouts: 1 marks the label Field label, 2 the multi-line input showing the placeholder Input example, and 3 the description text below it.
- Label (optional) says what to write.
- Input holds several lines of text.
rowssets its starting height,resizecontrols manual resizing, andautosizegrows it with the text up tomaxAutoHeight. - Description (optional) adds guidance, such as a length limit.
States
Hover and focus styles are built in. required marks the label with an
asterisk. A disabled textarea cannot be used, and a read-only one shows its
text without allowing edits. Set error with an errorDescription that says
how to fix the text: a red outline, warning icon and the message appear
together. success adds a green outline and check icon once it is valid.
The field is capped at 480 px; use fluid for a wider writing area.
Themes
The design includes Spark and Ocean appearances. Use the page's theme and mode controls to compare the live examples; retain the same labels, states and validation messages in each theme.
Guidelines
- Name the purpose in the label, such as "Describe your issue".
- Keep placeholders brief; put instructions in the description, which stays visible while people type.
- Size the field for the expected text so people don't scroll.
- When text is limited, set
maxlengthand show a character count supplied by your application; the textarea has no built-in counter.