Textarea โ
A multi-line text input with sizes, color and visual variants, validation states, slot-overridable label and helper, JS-driven auto-resize, and an optional character counter. Toggle Vue / CSS to switch the live demo and source together.
Basic โ
Default textarea with label, placeholder and helper text.
Vue SFC
Sizes โ
Small, medium and large.
Vue SFC
Variants โ
outlined, filled and underlined.
underlined focuses with a soft glow under the line rather than a ring around the field โ tune it with --mono-textarea-underline-glow (default 0 5px 6px -6px).
Vue SFC
Colors โ
All built-in color variants.
Vue SFC
States โ
Disabled, readonly and required.
Vue SFC
Validation โ
valid, invalid and warning states with messages.
Vue SFC
Auto resize โ
Grow with content between min-rows and max-rows.
Vue SFC
Counter โ
Live character count via show-counter and max-length.
Vue SFC
Slots โ
Custom label and helper content via named slots.
Vue SFC
Event log โ
Live log of mno-input and mno-change events.
Vue SFC
Customized โ
Override per-element styling with cssClass (Vue) or extra utility classes (CSS).
Vue SFC
Width & height โ
Set width, height, min-width, max-width, min-height or max-height โ each takes a CSS string ("320px", "80%") or a number (px). Fields are full width by default; set width to constrain.
Vue SFC
CSS Variables โ
Vue SFC
Every textarea is themed through --mono-textarea-* custom properties. Setting one on the element, on any wrapper/ancestor, or inline all work โ custom properties inherit, and they pierce the shadow-DOM boundary, so the same overrides apply to <mono-textarea> and the shadow build. The color prop sets the focus accent, but an explicit --mono-textarea-focus-color override always wins. To re-skin globally, set the underlying --theme-* tokens.
| Variable | Default | Controls |
|---|---|---|
--mono-textarea-focus-color | --theme-primary | Focus border color (set by color) |
--mono-textarea-focus-rgb | primary rgb | Focus ring color (as r, g, b) |
--mono-textarea-underline-glow | 0 5px 6px -6px | Underlined focus glow geometry |
--mono-textarea-text | --theme-text | Field + label text color |
--mono-textarea-border | --theme-border | Field border color |
--mono-textarea-background | --theme-background | Field background (filled/default) |
--mono-textarea-surface | --theme-surface | Field background (outlined) |
--mono-textarea-placeholder | --theme-placeholder | Placeholder color |
--mono-textarea-shadow | 0 1px 2px โฆ | Field shadow |
--mono-textarea-success | --theme-success | Valid-state color |
--mono-textarea-danger | --theme-danger | Invalid / required color |
--mono-textarea-warning | --theme-warning | Warning-state color |
Types โ
Import
import { TextareaProps } from 'mono-helper'| Prop | Value | Default | Description |
|---|---|---|---|
modelValue | string | โ | Two-way bound text value of the textarea. |
value | string | โ | Text value (kept in sync with modelValue). |
name | string | โ | Form field name for the underlying textarea. |
placeholder | string | โ | Placeholder text shown when empty. |
label | string | โ | Text label shown above the textarea. |
helperText | string | โ | Helper text shown below the textarea. |
validationState | 'warning' | 'default' | 'valid' | 'invalid' | โ | Validation state controlling field styling. |
validationMessage | string | โ | Message shown for the current validation state. |
errorMessage | string | โ | Error message that forces the invalid state. |
successMessage | string | โ | Success message that forces the valid state. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | โ | Size of the textarea. |
color | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | โ | Color theme of the textarea. |
variant | 'underlined' | 'outlined' | 'filled' | โ | Visual style of the textarea. |
disabled | boolean | โ | Disables interaction with the textarea. |
readonly | boolean | โ | Makes the textarea read-only. |
required | boolean | โ | Marks the field as required. |
autofocus | boolean | โ | Focuses the textarea on first render. |
autoResize | boolean | โ | Automatically grows the height to fit content. |
rows | number | โ | Initial number of visible text rows. |
minRows | number | โ | Minimum number of rows when auto-resizing. |
maxRows | number | โ | Maximum number of rows when auto-resizing. |
minLength | number | โ | Minimum allowed character length. |
maxLength | number | โ | Maximum allowed character length. |
showCounter | boolean | โ | Shows a character counter below the field. |
ariaLabelText | string | โ | Accessible label for screen readers. |
ariaLabel | string | โ | โ |
width | string | number | โ | Explicit sizing. Each accepts a CSS length string (`"320px"`, `"80%"`) or a number (interpreted as px). Use `width="100%"` for a full-width field. |
height | string | number | โ | โ |
minWidth | string | number | โ | โ |
maxWidth | string | number | โ | โ |
minHeight | string | number | โ | โ |
maxHeight | string | number | โ | โ |
cssClass | TextareaCssClass | โ | Per-part class overrides for styling internal elements. |
visible | boolean | โ | Whether the control is shown. Defaults to `true`. |
visibleType | 'invisible' | 'none' | โ | How it hides when `visible` is `false`. Defaults to `'none'`. |