Textarea
A multi-line text field that grows with its content, with an optional label, helper text and error message.
Installation
Usage
src/app/app.ts
[(value)]updates your signal on every keystroke. Setting the signal from code updates the field too.- The field opens three lines tall and grows as the user types.
classstyles the whole block of label, field and message.
Height limits
minLinessets the starting height.maxLinesstops the growth. Past it, the field scrolls and shows a scroll bar. Without it, the field keeps growing.- Each line is 20 pixels, the line height of the field's text.
Helper text and errors
A non-empty error replaces the helper text with red text and turns the focus ring red. The field shakes when an error first appears.
Disabled
Signal Forms
UiTextarea implements Angular's FormValueControl, so [formField] works on it the same way as on Input.
API
UiTextarea
Related
- Input: a single-line field
- Forms: forms and the on-screen keyboard
<textarea>: the element underneath
