Skip to content

GhostInput reference ​

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

Themed wrapper around headless GhostInput. Same behavioral props plus size and block. 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.

All component references

Props ​

NameTypeDefaultRequiredDescription
modelValuestring—NoControlled value, forwarded to the unstyled GhostInput. Omit for uncontrolled mode.
defaultValuestring""NoInitial uncontrolled value, forwarded to the unstyled GhostInput.
type'text' | 'search' | 'email' | 'password' | 'tel' | 'url'"text"NoNative text-like type, forwarded to the unstyled GhostInput.
disabledbooleanfalseNoForwards native disabled semantics to the unstyled GhostInput.
readonlybooleanfalseNoForwards native readonly semantics to the unstyled GhostInput.
invalidbooleanfalseNoForwards consumer-owned validity to the unstyled GhostInput.
requiredbooleanfalseNoForwards native required to the unstyled GhostInput.
size'sm' | 'md' | 'lg'"md"NoControl size. The default omits data-size so CSS can treat a missing hook as md.
blockbooleanfalseNoStretch to the available inline size via data-block.

Emits ​

None declared.

Models ​

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

Slots ​

None declared.

Exposed members ​

NameTypeDescription
elementHTMLInputElement | nullThe native input after mount; null before mount and after unmount. Delegates to the unstyled GhostInput.
focus(options?: FocusOptions) => voidFocuses the native input when it is mounted and not disabled. Delegates to the unstyled GhostInput.
blur() => voidRemoves focus from the native input when it is mounted. Delegates to the unstyled GhostInput.

Parts and data attributes ​

AttributeValueDescription
data-partrootThe native input inside the display:contents themed scope.
data-stateinvalidConsumer-owned invalid appearance. Wins data-state when overlapping disabled or readonly.
data-statedisabledUnavailable appearance. Prefer the native disabled attribute when both apply.
data-statereadonlyRead-only appearance. Omitted while invalid or disabled.

CSS variables ​

NameDescription
--ghost-surface-bgResting field fill.
--ghost-surface-muted-bgReadonly field fill.
--ghost-text-defaultTyped text color.
--ghost-text-mutedPlaceholder text color.
--ghost-border-defaultResting field border.
--ghost-border-strongHover field border.
--ghost-border-dangerInvalid field border.
--ghost-border-hairline-widthField border thickness.
--ghost-status-danger-bgInvalid field fill.
--ghost-status-danger-fgInvalid field text.
--ghost-action-disabled-bgDisabled field fill.
--ghost-action-disabled-fgDisabled field text.
--ghost-action-disabled-borderDisabled field border.
--ghost-action-radiusField corner radius.
--ghost-action-durationColor and shadow transition duration.
--ghost-focus-ring-colorOuter color of the two-color keyboard focus indicator.
--ghost-focus-ring-contrastInner color of the two-color keyboard focus indicator.
--ghost-focus-ring-offsetGap between the field edge and the focus ring.
--ghost-focus-ring-widthThickness of the focus outline.
--ghost-control-size-sm-minMinimum block size for size sm.
--ghost-control-size-md-minMinimum block size for size md.
--ghost-control-size-lg-minMinimum block size for size lg.

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/account-details ​

Example source

Account details

Account form with labels, hints, live email validation, and readonly and disabled fields.

input/themed ​

Example source

Themed

Size props on the @ghostvue/themes wrapper, with aligned labels.

input/states ​

Example source

States

Disabled, readonly, invalid, and required, composed with GhostField.

Use letters, numbers, and hyphens only.

Example source

Search

Controlled type=search filtering a local list of reports.

input/unit-suffix ​

Example source

Unit suffix

A visible unit beside the input, read as the first description and never submitted.

seconds

Example source

Clearable search

Report search with a decorative icon and a Clear button that returns focus to the field and never submits.

input/duration ​

Example source

Duration (mm:ss)

A minutes-and-seconds field that parses to whole seconds, shows a field error for out-of-range seconds, and drives a progress bar.

checkout-api canary

Tideline promotes the canary to production after it bakes without errors.

Baking in us-east02:10 of 05:00