Text Area Styling
Style Variants
The following style variants can be applied:
| Variant | Description | Supported by |
|---|---|---|
| Aligns the text to the left side of the field (default) | Aura, Lumo |
| Centers the text within the field | Lumo |
| Aligns the text to the right side of the field. Recommended for numerical values when presented in vertical groups. | Aura, Lumo |
| Aligns the text to the start side of the field, taking into account the current text direction (left for LTR, right for RTL) | Aura |
| Aligns the text to the end side of the field, taking into account the current text direction (right for LTR, left for RTL) | Aura |
| Renders a more compact field | Lumo |
| Renders the helper above the field, and below the label | Aura, Lumo |
Style Properties
The following style properties can be used in CSS stylesheets to customize the appearance of this component.
To apply values to these properties globally in your application UI, place them in a CSS block using the html {…} selector.
See Component Style Properties for more information on style properties.
|
Note
|
Input Field Components Shared Styles
Style properties whose names start with --vaadin-input-field are shared among all input field components. To apply them only to a specific type of component, use an element selector like vaadin-text-field {…}
|
Field Surface
Common Properties
| Property | Supported by |
|---|---|
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura |
| Lumo |
| Aura |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
Field States
| Property | Supported by |
|---|---|
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Lumo |
| Lumo |
| Lumo |
| Lumo |
| Lumo |
| Lumo |
Label
| Property | Supported by |
|---|---|
| Lumo |
| Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
Helper
| Property | Supported by |
|---|---|
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Lumo |
CSS Selectors
The following CSS selectors can be used in stylesheets to target the various parts and states of the component. See the Styling documentation for more details on how to style components.
- Root element
-
vaadin-text-area
States
- Required
-
vaadin-text-area[required] - Focused
-
vaadin-text-area[focused] - Keyboard focused
-
vaadin-text-area[focus-ring] - Read-only
-
vaadin-text-area[readonly] - Disabled
-
vaadin-text-area[disabled] - Not empty
-
vaadin-text-area[has-value] - Hovered
-
vaadin-text-area:hover
Field
- Field surface (background, border)
-
vaadin-text-area::part(input-field) - Native input element
-
vaadin-text-area> textarea - Input field with placeholder shown
-
vaadin-text-area> textarea:placeholder-shown - Clear button
-
vaadin-text-area::part(clear-button) - Clear button icon
-
vaadin-text-area::part(clear-button)::before - Prefix element
-
vaadin-text-area> [slot="prefix"] - Suffix element
-
vaadin-text-area> [slot="suffix"]
Label
- Field with label
-
vaadin-text-area[has-label] - Label
-
vaadin-text-area::part(label) - Label text
-
vaadin-text-area> label - Required indicator
-
vaadin-text-area::part(required-indicator)
Helper and Validation Error
- Field with helper
-
vaadin-text-area[has-helper] - Helper
-
vaadin-text-area::part(helper-text) - Helper text
-
vaadin-text-area> [slot="helper"] - Invalid field
-
vaadin-text-area[invalid] - Field with error message
-
vaadin-text-area[has-error-message] - Error message
-
vaadin-text-area::part(error-message) - Error message text
-
vaadin-text-area> [slot="error-message"]