Textarea

Takes longer text, growing with its content up to a limit and then scrolling.

Refined portVue source: WildTextareaBase.vueStorybook story: Forms/Textarea

Try it

Type in it. Past 90% of the limit, the counter turns amber.

0/120
Size
Error
Disabled
Max length
<WildTextareaBase
  v-model="notes"
  size="sm"
  :max-length="120"
/>

When to use

  • Use a textarea for free text that runs past one line, such as notes.
  • Set maxLength when the text has a hard limit, so people see the count before they reach it.
Don’t use it
  • For a single line, such as a name. Use Text input.

Sizes

sm is 140px tall with 12px text; lg is 200px with 13px. Both resize vertically only.

sm · 140px
lg · 200px

States

rest
hover
focus
default
error
disabled
Error outranks focus, so a field that’s both keeps its red edge and gains the focus ring outside it. Both draw a 2px edge inside the 1px border, so the text never moves.

Accessibility

It’s a native textarea, so typing and selection work as usual. Give it a name with ariaLabel. Error sets aria-invalid, and the counter is announced politely as it changes.

KeyWhat it does
TabMoves focus into the textarea, and out again.

Props

PropTypeDefaultDescription
modelValuestring—The text.
size'sm' | 'lg''sm'140px or 200px tall.
maxLengthnumber—Adds a counter; it turns amber past 90%.
placeholderstring—A prompt shown while empty.
errorbooleanfalseA 2px red edge; sets aria-invalid.
disabledbooleanfalseGreys the field and blocks typing.
ariaLabelstring—Accessible name.

Tokens

TokenValueWhere it lands
--radius-lg8pxCorners, the same as every field.
--font-size-sm12pxText at sm.
--font-size-md13pxText at lg.
--global-neutral-grey-600#DCDCDEBorder at rest, 1px.
--global-neutral-grey-800#ADACB0Border on hover.
--global-blue-1000#1877F2The 2px edge on focus, and the caret.
--global-red-800#E12121The 2px edge on error.
(no token)0 0 0 3px, 12%Halo on focus.
--global-neutral-grey-300#F1F1F1Ground when disabled.
--global-neutral-grey-1000#4F4D55Placeholder and counter.
--color-warning-active#9D6508Counter past 90%.