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.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
autoResize | boolean | false | No | Grow the field with its content after mount. Off by default so native resize and a fixed rows height remain the ordinary path. |
defaultValue | string | "" | No | Initial uncontrolled value. Later changes are ignored. |
disabled | boolean | false | No | Native disabled semantics: not focusable, not editable, omitted from form submit. |
invalid | boolean | false | No | Sets aria-invalid=true. Error copy belongs to Field or the surrounding form. |
maxRows | number | — | No | Auto-resize ceiling in rows. Ignored unless autoResize is true. When set below rows, rows wins as both min and max. |
modelValue | string | — | No | Controlled value. Omit for uncontrolled mode; an empty string is a defined empty value. |
readonly | boolean | false | No | Native readonly semantics: focusable and submitted, but the user agent rejects edits. |
required | boolean | false | No | Native required constraint. Validation messaging stays with the form. |
rows | number | 2 | No | Native rows. Matches the HTML default. Auto-resize uses this as the minimum height. |
submitOnEnter | boolean | false | No | Enter 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
| Prop | Event | Type | Description |
|---|---|---|---|
modelValue | update:modelValue | string | v-model binding for the textarea string. |
Slots
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
blur | () => void | Removes focus from the native textarea when it is mounted. No-op before mount. |
element | HTMLTextAreaElement | null | The native textarea after mount; null before mount and after unmount. |
focus | (options?: FocusOptions) => void | Focuses the native textarea when it is mounted and enabled. No-op before mount. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | The native textarea element. |
data-state | disabled | Unavailable field. Wins data-state when overlapping readonly or invalid. Prefer the native disabled attribute. |
data-state | readonly | Focusable but not editable. Wins data-state over invalid. Native readonly remains the semantic source of truth. |
data-state | invalid | Consumer-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
| Key | Action | Automated browser test |
|---|---|---|
Enter | Insert a newline. Does not submit the form. With submitOnEnter, submits the form owner instead; not while composing or read-only. | Not reviewed |
Tab | Leave the field. Native tab order. | Not reviewed |
Shift+Enter | Insert 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.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Not reviewed | No declared key is mapped to a browser test yet. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
textarea/basic
Labeled native textarea with v-model.
textarea/composable
Same contract as GhostTextarea, applied to a native host.
textarea/ref
Template refs expose element, focus, and blur.