Skip to content

GhostTextarea reference ​

Package: @ghostvue/vue. Status: experimental (stability policy).

Headless native multiline text control. useGhostTextarea owns v-model, disabled/readonly/invalid/required, and SSR-safe auto-resize; GhostTextarea is the thin unstyled textarea. Themed styles live on @ghostvue/themes.

Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.

All component references

Props ​

NameTypeDefaultRequiredDescription
autoResizebooleanfalseNoGrow the field with its content after mount. Off by default so native resize and a fixed rows height remain the ordinary path.
defaultValuestring""NoInitial uncontrolled value. Later changes are ignored.
disabledbooleanfalseNoNative disabled semantics: not focusable, not editable, omitted from form submit.
invalidbooleanfalseNoSets aria-invalid=true. Error copy belongs to Field or the surrounding form.
maxRowsnumber—NoAuto-resize ceiling in rows. Ignored unless autoResize is true. When set below rows, rows wins as both min and max.
modelValuestring—NoControlled value. Omit for uncontrolled mode; an empty string is a defined empty value.
readonlybooleanfalseNoNative readonly semantics: focusable and submitted, but the user agent rejects edits.
requiredbooleanfalseNoNative required constraint. Validation messaging stays with the form.
rowsnumber2NoNative rows. Matches the HTML default. Auto-resize uses this as the minimum height.
submitOnEnterbooleanfalseNoEnter submits the textarea's form owner with requestSubmit() instead of inserting a newline; Shift+Enter still inserts one. Ignored during IME composition, while read-only, and for held-key repeats. Without a form owner, Enter stays native and a development warning (GHOST029) is logged once.

Emits ​

None declared.

Models ​

PropEventTypeDescription
modelValueupdate:modelValuestringv-model binding for the textarea string.

Slots ​

None declared.

Exposed members ​

NameTypeDescription
blur() => voidRemoves focus from the native textarea when it is mounted. No-op before mount.
elementHTMLTextAreaElement | nullThe native textarea after mount; null before mount and after unmount.
focus(options?: FocusOptions) => voidFocuses the native textarea when it is mounted and enabled. No-op before mount.

Parts and data attributes ​

AttributeValueDescription
data-partrootThe native textarea element.
data-statedisabledUnavailable field. Wins data-state when overlapping readonly or invalid. Prefer the native disabled attribute.
data-statereadonlyFocusable but not editable. Wins data-state over invalid. Native readonly remains the semantic source of truth.
data-stateinvalidConsumer-owned invalid. Used when the field is neither disabled nor readonly. Themed CSS also keys off aria-invalid.

CSS variables ​

None declared.

Accessibility ​

Role: textbox. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/textbox/.

Required ARIA attributes: none.

Keyboard ​

KeyActionAutomated browser test
EnterInsert a newline. Does not submit the form. With submitOnEnter, submits the form owner instead; not while composing or read-only.Not reviewed
TabLeave the field. Native tab order.Not reviewed
Shift+EnterInsert a newline, with or without submitOnEnter.Not reviewed

Verification ​

Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.

CategoryStatusEvidence
Automated keyboardNot reviewedNo declared key is mapped to a browser test yet.
Manual interactionNot reviewedNo review recorded.
Assistive technologyNot reviewedNo review recorded.

Examples ​

textarea/basic ​

Example source

Basic Headless

Labeled native textarea with v-model.

textarea/composable ​

Example source

Composable Headless

Same contract as GhostTextarea, applied to a native host.

textarea/ref ​

Example source

Component ref Headless

Template refs expose element, focus, and blur.