Skip to content

Textarea ​

Multi-line text input with label, help text, error state, and optional character count.

Demo ​

Basic

Beskriv din situation så detaljeret som muligt

Character limit

Du har 60 tegn tilbage

Error state

Disabled

Larger

Installation ​

vue
<script setup>
import { GTTextarea } from '@grundtone/vue';
</script>

In Nuxt, GTTextarea is auto-imported.

When to use ​

Use for unstructured text of more than 2 lines. Set rows to match expected input length.

Do not use for structured data or single-line input (use GTInput).

Usage ​

Basic ​

vue
<GTTextarea v-model="comment" label="Kommentar" placeholder="Skriv her..." />

With character limit ​

vue
<GTTextarea v-model="text" label="Beskrivelse" :max-chars="200" />

Shows remaining characters. When over limit, counter turns red but input is NOT blocked.

Error state ​

vue
<GTTextarea v-model="text" label="Begrundelse" error-text="Feltet er påkrævet" />

Custom rows ​

vue
<GTTextarea v-model="text" label="Detaljer" :rows="8" />

Props ​

PropTypeDefaultDescription
modelValuestring''Bound value (v-model)
labelstring—Visible label
helpTextstring—Help text
errorTextstring—Error message (replaces helpText)
placeholderstring—Placeholder text
requiredbooleanfalseRequired field
disabledbooleanfalseDisabled state
readonlybooleanfalseReadonly state
rowsnumber4Visible rows
maxCharsnumber—Max characters (shows counter)
namestring—HTML name
idstringautoHTML id
blockbooleanfalseFull-width

Events ​

EventPayloadDescription
update:modelValuestringInput change
focusFocusEventFocus
blurFocusEventBlur

Accessibility ​

  • Label associated via for/id
  • aria-invalid on error or over-limit
  • aria-describedby for help/error text
  • aria-required when required
  • Character count uses aria-live="polite"

See Textarea (Design System) for full CSS reference.