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 Examples

Basic

Multiline text inside GkField.

Trim on blur

v-model.trim clears leading/trailing whitespace when the control loses focus.

Readonly

Read-only body with optional field error region for validation messaging.

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
size'xs' | 'sm' | 'md' | 'lg' | 'xl'Visual control scale; omit for GK_FORM_CONTROLS / global defaults

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

Each scenario under Live Examples includes a copyable Vue snippet.

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.