Skip to content

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.

All component references

Props ​

NameTypeDefaultRequiredDescription
defaultValuestring""NoInitial uncontrolled value. Later changes are ignored. Also the form-reset seed.
disabledbooleanfalseNoApplies native disabled semantics, prevents editing and sequential focus, and omits the field from form submit.
invalidbooleanfalseNoConsumer-owned validity. Sets aria-invalid and data-state=invalid. Does not mirror native ValidityState.
modelValuestring—NoControlled value. Omit for uncontrolled mode. An empty string is a real controlled value, not unset.
readonlybooleanfalseNoApplies native readonly semantics. The field stays focusable and is submitted, but cannot be edited.
requiredbooleanfalseNoApplies the native required constraint.
typeGhostInputType"text"NoNative text-like type (text, search, email, password, tel, url). Checkbox, radio, file, and number are out of scope.

Emits ​

None declared.

Models ​

PropEventTypeDescription
modelValueupdate:modelValuestringv-model binding for the input string. Updates on the native input event.

Slots ​

None declared.

Exposed members ​

NameTypeDescription
blur() => voidRemoves focus from the native input when it is mounted.
elementHTMLInputElement | nullThe native input after mount, or `null` before mount.
focus(options?: FocusOptions) => voidMoves focus to the native input when it is mounted and not disabled.

Parts and data attributes ​

AttributeValueDescription
data-partrootThe native input element.
data-stateinvalidConsumer-owned invalid. Wins over disabled and readonly when more than one applies.
data-statedisabledUnavailable field. Prefer the native disabled attribute when both apply. Omitted while invalid.
data-statereadonlyRead-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 ​

KeyActionAutomated browser test
TabMove sequential focus into or out of the field when it is not disabled.Not reviewed
EnterMay 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.

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

Examples ​

input/basic ​

Example source

Basic Headless

Native labeled text field. The default type is text.

input/composable ​

Example source

Composable Headless

Same contract as GhostInput, applied to a native host.

input/ref ​

Example source

Component ref Headless

Template refs expose element, focus, and blur.

input/clearable-search-headless ​

Example source

Clearable search (headless) Headless

The same clearable search with headless parts and styles the example owns.