Inputs

Textarea

A multi-line input that grows with what you type, starting at three lines.

Examples

Textarea

field-sizing: content — grows with what you type.

Anatomy

textarea.inputSame fill, focus ring and invalid ring as .input. Every <textarea> gets field-sizing: content and a minimum of three lines from the reset.

API

AttributeValuesDescription
requiredbooleanAs on .input: once the user has left it empty, :user-invalid draws the danger ring.
disabledbooleanHalves the opacity.

Accessibility

  • Label it like any input, with <label for> or aria-label.
  • Because it grows with its content, set a max-block-size when the text can get long, or the page reflows on every line.
KeyEffect
EnterInserts a line break; it does not submit the form.
TabLeaves the textarea; it does not insert a tab character.
Jump to
ProportionFoundations
MaterialFoundations
PresetsFoundations
ShellLayouts · Application
Container and stacksLayouts · Pages
SplitLayouts · Pages
Grid, bento, masonryLayouts · Pages
Switcher and rowLayouts · Pages
↑↓Move↵OpenescClose