GhostInput reference
Package: @ghostvue/vue. Status: experimental (stability policy).
Headless native text field. useGhostInput owns the string model and disabled/readonly/invalid/required; GhostInput is the thin unstyled element. Themed visual props 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 |
|---|---|---|---|---|
defaultValue | string | "" | No | Initial uncontrolled value. Later changes are ignored. Also the form-reset seed. |
disabled | boolean | false | No | Applies native disabled semantics, prevents editing and sequential focus, and omits the field from form submit. |
invalid | boolean | false | No | Consumer-owned validity. Sets aria-invalid and data-state=invalid. Does not mirror native ValidityState. |
modelValue | string | — | No | Controlled value. Omit for uncontrolled mode. An empty string is a real controlled value, not unset. |
readonly | boolean | false | No | Applies native readonly semantics. The field stays focusable and is submitted, but cannot be edited. |
required | boolean | false | No | Applies the native required constraint. |
type | GhostInputType | "text" | No | Native text-like type (text, search, email, password, tel, url). Checkbox, radio, file, and number are out of scope. |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
modelValue | update:modelValue | string | v-model binding for the input string. Updates on the native input event. |
Slots
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
blur | () => void | Removes focus from the native input when it is mounted. |
element | HTMLInputElement | null | The native input after mount, or `null` before mount. |
focus | (options?: FocusOptions) => void | Moves focus to the native input when it is mounted and not disabled. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | The native input element. |
data-state | invalid | Consumer-owned invalid. Wins over disabled and readonly when more than one applies. |
data-state | disabled | Unavailable field. Prefer the native disabled attribute when both apply. Omitted while invalid. |
data-state | readonly | Read-only field. Omitted while invalid or disabled. |
CSS variables
None declared.
Accessibility
Role: textbox. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/textfield/.
Required ARIA attributes: none.
Keyboard
| Key | Action | Automated browser test |
|---|---|---|
Tab | Move sequential focus into or out of the field when it is not disabled. | Not reviewed |
Enter | May submit an ancestor form for text and search types. | 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
input/basic
Native labeled text field. The default type is text.
input/composable
Same contract as GhostInput, applied to a native host.
input/ref
Template refs expose element, focus, and blur.
input/clearable-search-headless
The same clearable search with headless parts and styles the example owns.