TextArea
The text-area component.
- Import
import "@tapsioss/web-components/text-area";
- Tag
<tapsi-text-area></tapsi-text-area>
Properties
Name | Description | Type | Default Value |
---|---|---|---|
value | The current value of the input. It is always a string. | string | "" |
name | The HTML name to use in form submission. | string | "" |
disabled | Whether or not the element is disabled. | boolean | false |
required | Indicates 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/required | boolean | false |
maxlength | The 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#maxlength | number | -1 |
minlength | The 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#minlength | number | -1 |
placeholder | Defines 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/placeholder | string | "" |
readonly | Indicates 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#readonly | boolean | false |
autocomplete | Describes what, if any, type of autocomplete functionality the input should provide. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete | string | "" |
supporting-text | Conveys additional information below the text input, such as how it should be used. | string | "" |
error | Gets or sets whether or not the text input is in a visually invalid state. This error state overrides the error state controlled by reportValidity() . | boolean | false |
error-text | The 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 | "" |
label | The 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-label | string | "" |
labelledby | Identifies the element (or elements) that labels the input. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby | string | "" |
size | The size of the input. | "sm" | "md" | "md" |
hide-label | Whether to hide the label or not. | boolean | false |
rounded | Whether the input is rounded or not. | boolean | false |
no-active-border | Whether to show the active border around the input or not. | boolean | false |
rows | The number of rows to display for the text input. Defaults to 2. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#rows | number | 2 |
cols | The number of cols to display for the text input. Defaults to 20. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#cols | number | 20 |
Slots
Name | Description |
---|---|
leading-icon | the leading icon slot of the text-area |
trailing | the 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"