Skip to content

VTextArea

Props

NameTypeDescription
autofocusbooleanIndicates that this element should get focus after the page finishes loading.
char-countbooleanUse in combination with maxlength to display a character count.
colsnumberSizes the element horizontally by a number of character columns.
disabledbooleanSets the element's disabled state. A disabled element will not be included during form submission.
error-textstringProvides a custom error message. Any current error state will be overridden.
formstringThe https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
helper-textstringProvides additional information to help the user enter the correct information. To add HTML to the helper text, use the helper-text slot instead.
initial-valuestringThe default value of the element. This value sets the value property only when the value property has not been explicitly set.
labelstringThe label for the form element.
liststringAllows associating a https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist
maxlengthnumberThe maximum number of characters a user can enter.
minlengthnumberThe minimum number of characters a user can enter.
namestringThe name of the element. This element's value will be surfaced during form submission under the provided name.
placeholderstringSets the placeholder value of the element, generally used to provide a hint to the user.
read-onlybooleanWhen true, the control will be immutable by user interaction. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly
requiredbooleanRequire the field to be completed prior to form submission.
resizeEnum:
none
both
horizontal
vertical
The resize mode of the element.
rowsnumberSizes the element vertically by a number of character rows.
spellcheckbooleanSets if the element is eligible for spell checking but the UA.
success-textstringProvides a custom success message. Any current error state will be overridden.
valuestringThe current value of the element.
wrapEnum:
hard
soft
off
The wrap attribute

Events

NameEvent TypeDescription
blurFocusEventFires when the element loses focus.
changeCustomEvent<undefined>Emits a custom 'change' event when the textarea emits a change event
clickMouseEventFires when a pointing device button (such as a mouse's primary mouse button) is both pressed and released while the pointer is located inside the element.
focusFocusEventFires when the element receives focus.
inputEventFires when the value of an element has been changed.
keydownKeyboardEventFires when a key is pressed.
keyupKeyboardEventFires when a key is released.

Slots

NameDescription
helper-textDescribes how to use the text-area. Alternative to the helper-text attribute.

Methods

NameTypeDescription
checkValidity() => booleanReturn the current validity of the element.
reportValidity() => booleanReturn the current validity of the element. If false, fires an invalid event at the element.
select() => unknownSelects all the text in the text area
validate() => void{@inheritDoc (FormAssociated:interface).validate}