GhostTextarea reference
Package: @ghostvue/themes. Status: experimental (stability policy).
Themed wrapper around headless GhostTextarea. Same behavioral props plus size. Importing it loads the default stylesheet and scopes styles to this instance. Hand-written until GHO-13 generates manifests.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
modelValue | string | — | No | Controlled value, forwarded to the unstyled GhostTextarea. |
defaultValue | string | "" | No | Initial uncontrolled value, forwarded to the unstyled GhostTextarea. |
disabled | boolean | false | No | Forwards native disabled semantics to the unstyled GhostTextarea. |
readonly | boolean | false | No | Forwards native readonly semantics to the unstyled GhostTextarea. |
invalid | boolean | false | No | Forwards invalid semantics to the unstyled GhostTextarea. |
required | boolean | false | No | Forwards native required to the unstyled GhostTextarea. |
rows | number | 2 | No | Native rows, forwarded to the unstyled GhostTextarea. |
maxRows | number | — | No | Auto-resize ceiling, forwarded to the unstyled GhostTextarea. |
autoResize | boolean | false | No | Forwards auto-resize to the unstyled GhostTextarea. |
submitOnEnter | boolean | false | No | Forwards submit-on-Enter to the unstyled GhostTextarea. A consumer @keydown still runs first and can cancel it. |
size | 'sm' | 'md' | 'lg' | "md" | No | Control size. The default omits data-size so CSS can treat a missing hook as md. |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
modelValue | update:modelValue | string | v-model binding forwarded to the unstyled GhostTextarea. |
Slots
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
element | HTMLTextAreaElement | null | The native textarea after mount; null before mount and after unmount. Delegates to the unstyled GhostTextarea. |
focus | (options?: FocusOptions) => void | Focuses the native textarea when it is mounted and enabled. Delegates to the unstyled GhostTextarea. |
blur | () => void | Removes focus from the native textarea when it is mounted. Delegates to the unstyled GhostTextarea. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | The textarea element inside the display:contents themed scope. |
data-state | disabled | Unavailable appearance from native disabled and data-state. |
data-state | readonly | Inset appearance for readonly fields. |
data-state | invalid | Danger border from aria-invalid, including when readonly. |
CSS variables
| Name | Description |
|---|---|
--ghost-elevation-1-bg | Field fill at rest. |
--ghost-surface-fg | Field text color. |
--ghost-text-muted | Placeholder color. |
--ghost-border-default | Resting border color. |
--ghost-border-hairline-width | Border thickness. |
--ghost-border-danger | Invalid border color. |
--ghost-border-focus | Focused border color. |
--ghost-action-disabled-bg | Disabled fill. |
--ghost-action-disabled-border | Disabled border color. |
--ghost-action-disabled-fg | Disabled text color. |
--ghost-action-radius | Corner radius. |
--ghost-control-size-md-padding-block | Default block padding. sm/lg swap the matching control size tokens. |
--ghost-control-size-md-padding-inline | Default inline padding. |
--ghost-control-size-md-font | Default font size. |
--ghost-type-family-sans | Field font family. |
--ghost-type-line-normal | Field line height, also used as the auto-resize fallback for line-height: normal. |
--ghost-focus-ring-color | Outer focus ring color. |
--ghost-focus-ring-contrast | Inner focus ring contrast. |
--ghost-focus-ring-width | Focus ring thickness. |
--ghost-focus-ring-offset | Focus ring offset. |
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. 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/release-notes
Auto-resizing, readonly, and disabled GhostTextarea fields with live word count.
textarea/themed
Visual size on the @ghostvue/themes wrapper.
textarea/states
Disabled, readonly, invalid, and required fields.
textarea/auto-resize
Grows with content until maxRows.
textarea/form
Native form submission of the textarea value.
textarea/submit-on-enter
Comment composer where Enter sends and Shift+Enter adds a line, with a visible key hint and read-only while sending.