Skip to content

GkTextarea

Native <textarea> with God Kit styling aligned with GkInput (wrapper, attrs forwarding, focus events). Works with GkField for labels and errors.

When to use

Use for free-form multi-line input such as notes, descriptions, and support context fields.

Live demo

API

Props

PropTypeDefaultDescription
modelValuestringrequiredBound text (v-model)
idstringOverrides injected field id
namestringForm name
rowsnumber4Visible rows
placeholderstringPlaceholder
disabledbooleanfalseDisabled
readonlybooleanfalseRead-only
autocompletestringAutocomplete hint
autofocusbooleanfalseFocus on mount
ariaLabelstringWhen not inside GkField

Root class applies to the wrapper; other attributes are forwarded to <textarea>.

Use v-model.trim to trim on blur (same idea as GkInput).

Events

EventPayloadDescription
update:modelValuestringEmitted on input
update:focusedbooleantrue on focus, false on blur

Expose

NameTypeDescription
textareaHTMLTextAreaElementNative element

Examples

Basic

vue
<script setup lang="ts">
import { GkField, GkTextarea } from 'god-kit/vue'
import { ref } from 'vue'
const notes = ref('')
</script>

<template>
  <GkField label="Notes">
    <GkTextarea v-model="notes" :rows="4" />
  </GkField>
</template>

Advanced

vue
<GkField label="Description">
  <GkTextarea v-model.trim="description" :rows="6" placeholder="Write details..." />
</GkField>

Edge case

vue
<GkField label="Readonly transcript" :error="error">
  <GkTextarea v-model="transcript" readonly />
</GkField>

Accessibility notes

  • Keep labels visible through GkField where possible; use ariaLabel only for standalone cases.
  • For long text, ensure focus styles remain visible in scrollable layouts.

Released under the MIT License.