Skip to content

GhostButton reference ​

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

Headless native action control. useGhostButton owns behavior; GhostButton 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
disabledbooleanfalseNoApplies native disabled semantics, prevents activation, and removes the button from sequential focus order.
loadingbooleanfalseNoConsumer-owned pending state. Prevents activation while remaining focusable, sets aria-disabled and aria-busy, and preserves slot content so the accessible name does not change.
typeGhostButtonType"button"NoNative button behavior. Defaults to button so a control inside a form does not submit unless the consumer opts in.

Emits ​

None declared.

Models ​

None declared.

Slots ​

NameDescription
defaultButton label and optional decorative content such as an icon. Icon-only use requires aria-label, aria-labelledby, or hidden text.

Slot props: default ​

None declared.

Exposed members ​

NameTypeDescription
blur() => voidRemoves focus from the native button when it is mounted. No-op before mount.
elementHTMLButtonElement | nullThe native button after mount; null before mount and after unmount.
focus(options?: FocusOptions) => voidFocuses the native button when it is mounted and enabled. No-op before mount.

Parts and data attributes ​

AttributeValueDescription
data-partrootThe native button element.
data-particonOptional decorative icon content inside the default slot.
data-partloading-indicatorOptional decorative pending indicator inside the default slot. Replaces the themed default spinner when present.
data-stateloadingPending action. Used when native disabled is the wrong focus model. Wins over disabled when both props are true.
data-statedisabledUnavailable action. Prefer the native disabled attribute when both apply. Omitted while loading.

CSS variables ​

None declared.

Accessibility ​

Role: button. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/button/.

Required ARIA attributes: none.

Keyboard ​

KeyActionAutomated browser test
EnterActivate the button when it is enabled and not loading.Not reviewed
SpaceActivate the button when it is enabled and not loading.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 ​

button/basic ​

Example source

Basic Headless

Native action control. The default type is button.

button/composable ​

Example source

Composable Headless

Same contract as GhostButton, applied to a native host.

button/ref ​

Example source

Component ref Headless

Template refs expose element, focus, and blur.