Use for multi-line text input like messages, comments, or lengthy descriptions.
The q2-textarea element has one slot that can be used to insert custom content into the component.
An optional slot to display a custom label.
The q2-textarea element has one or more properties that support text localization. Those properties are indicated by the localizable badge in the description.
colsDefines the number of columns displayed in the field. If not set, the field will be full-width and respond to the window size.
disabledIndicates the field cannot be focused or interacted with.
errorsEach item in the errors array will appear below the input field when the field is focused.
hideLabelhide-labelHide's the field's <label> element from view.
Only use when a visible label is impractical.
hideMessageshide-messagesWhen true and the input field has an active validation error, the field shows the error state without displaying associated error messages below the field (from the errors array above).
Primarily used for dropdown selects and date pickers whose controls appear below the input field (where the error messages, if displayed, would also appear).
hintsEach item in the hints array will appear below the input field when the field is focused.
The errors array takes precedence over the hints array. If an input field has both hints and errors, only the errors will display.
Once all errors are resolved, the hints display the next time the field is focused.
labelThe label that appears above the field. This is announced by screen readers when the field is focused.
maxlengthDefines the maximum allowed input length in characters. Formatting characters (e.g. ., -, etc) are included in the maxlength comparison.
Make sure you account for them when setting the maxlength value.
Please set the rows attribute in correlation with maxlength to show as much text as possible in the field viewport.
optionalAppends "(optional)" to the field label, and sets aria-required on the nested input tag to false.
placeholderText that appears within the field when it is blurred and empty. Placeholder text disappears when the user focuses on the field and provides input.
Primarily used for rare cases in which a visible form label is not expected (e.g., search fields).
readonlyAppends "(read only)" to the field label, and field becomes unusable, but remains focusable.
Takes priority over optional if both are true.
resizeIndicates how the field is resizable.
rowsDefines the number of rows displayed in the field.
spellcheckDetermines whether the field is subject to spell-checking by the underlying browser or OS.
valueThe value of the field.
The q2-textarea element exposes events that can be used to send and receive data from the component based on user interaction.
Emitted when the field loses focus after the value has been changed.
{ value: string; }If an event handler is bound to the element using:
onchange property - The default handler will not fire, and the value must be updated in the custom handler.addEventListener("change") method - The default handler will fire alongside the custom handler.Emitted when the field value is updated.
{ value: string; }If an event handler is bound to the element using:
oninput property - The default handler will not fire, and the value must be updated in the custom handler.addEventListener("input") method - The default handler will fire alongside the custom handler.Emitted when the field loses focus after the value has been changed.
{ value: string; }Emitted when the field value is updated.
{ value: string; }The q2-textarea element exposes methods that can be used to perform various actions on the component.
Emulates focusing the <textarea>, centering the provided value, and emitting an input event.
This method leaves the focus on the <textarea> and as a result does not trigger the change event. If you want
to trigger the change event, move the focus to another element after calling this method.
setValue(value: string) => Promise<void>The following CSS variables are available to override the default theme styles of the q2-textarea component.
Many Tecton components consume other components to maintain visual and functional consistency. If you are looking for a CSS variable you think should exist but are not seeing it, it may be defined in one of the dependent components below. Either way, if you think it's something we should expose more conveniently, let us know!