Textarea

Multi-line text input that can grow with its content, with a size scale, autofill extension control, and invalid state styling.

import { Textarea } from "@plexui/vue/components/Textarea";

Examples

Overview

Variants

variant

Auto resize

rows
maxRows

Sizing

size
gutterSize

Disabled

Invalid

Auto select text

Autofill extensions

API

PropTypeDefaultDescription
value / v-model:valuestring | number—Controlled value; uncontrolled when omitted
default-valuestring | number—Initial value when uncontrolled
variant"outline" | "soft""outline"Visual style of the textarea
size"3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl""md"Control height for single-line equivalent
gutter-size"2xs" | "xs" | "sm" | "md" | "lg" | "xl"—Horizontal padding; defaults from size
disabledbooleanfalseDisable the textarea
read-onlybooleanfalseMake the textarea read-only (the native readonly attribute works too)
invalidbooleanfalseMark as invalid
allow-autofill-extensionsboolean!!nameAllow autofill extensions
auto-selectbooleanfalseSelect all contents when mounted
rowsnumber3Initial row count
auto-resizebooleanfalseGrow/shrink with content
max-rowsnumber—Max rows when auto-resize; defaults to the larger of rows and 10
classstring—Applied to the container <div>
@update:value(value: string) => void—Emitted on every input
@autofill() => void—Emitted when the browser autofills the textarea

Every other attribute and listener (placeholder, name, id, style, @input, @focus, @blur, ...) goes to the <textarea>.

Styling

Textarea reads these component tokens. Override them at any scope to restyle it:

  • --input-border-color-invalid: border color invalid (default var(--color-border-danger-outline))
  • --input-outline-border-color: outline border color (default var(--color-border-primary-outline))
  • --input-outline-border-color-focus: outline border color focus (default var(--alpha-50))
  • --input-outline-border-color-hover: outline border color hover (default light-dark(var(--alpha-25), var(--alpha-30)))
  • --input-placeholder-text-color: placeholder text color (default var(--color-text-tertiary))
  • --input-soft-background-color: soft background color (default var(--color-background-primary-soft-alpha))
  • --input-soft-border-color-focus: soft border color focus (default var(--alpha-20))