Skip to content

TextArea

The text-area component.

  • Import
    import "@tapsioss/web-components/text-area";
  • Tag
    <tapsi-text-area></tapsi-text-area>

Properties

NameDescriptionTypeDefault Value
valueThe current value of the input. It is always a string.string""
nameThe HTML name to use in form submission.string""
disabledWhether or not the element is disabled.booleanfalse
requiredIndicates that the user must specify a value for the input before the owning form can be submitted and will render an error state when reportValidity() is invoked when value is empty. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/requiredbooleanfalse
maxlengthThe maximum number of characters a user can enter into the text input. Set to -1 for none. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlengthnumber-1
minlengthThe minimum number of characters a user can enter into the text input. Set to -1 for none. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlengthnumber-1
placeholderDefines the text displayed in the text input when it has no value. Provides a brief hint to the user as to the expected type of data that should be entered into the control. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholderstring""
readonlyIndicates whether or not a user should be able to edit the text input's value. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonlybooleanfalse
autocompleteDescribes what, if any, type of autocomplete functionality the input should provide. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocompletestring""
supporting-textConveys additional information below the text input, such as how it should be used.string""
errorGets or sets whether or not the text input is in a visually invalid state. This error state overrides the error state controlled by reportValidity().booleanfalse
error-textThe error message that replaces supporting text when error is true. If errorText is an empty string, then the supporting text will continue to show. This error message overrides the error message displayed by reportValidity().string""
labelThe label of the text input. - If the hideLabel property is true, the label will be hidden visually but still accessible to screen readers. - Otherwise, a visible label element will be rendered. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelstring""
labelledbyIdentifies the element (or elements) that labels the input. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledbystring""
sizeThe size of the input."sm" | "md""md"
hide-labelWhether to hide the label or not.booleanfalse
roundedWhether the input is rounded or not.booleanfalse
no-active-borderWhether to show the active border around the input or not.booleanfalse
rowsThe number of rows to display for the text input. Defaults to 2. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#rowsnumber2
colsThe number of cols to display for the text input. Defaults to 20. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#colsnumber20

Slots

NameDescription
leading-iconthe leading icon slot of the text-area
trailingthe trailing slot of the text-area

TIP

You can use slot names as variables:

ts
import { Slots } from "@tapsioss/web-components/text-area";

console.log(Slots.LEADING_ICON); // "leading-icon"
console.log(Slots.TRAILING); // "trailing"