Skip to content

GhostAvatar reference ​

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

Headless user or entity avatar with SSR-safe image loading and initials or slot fallback. useGhostAvatar owns styling hooks and the client image probe; GhostAvatar is the thin unstyled host. Themed size hooks live on @ghostvue/themes.

Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.

All component references

Props ​

NameTypeDefaultRequiredDescription
altstring—No`img` accessible name; defaults to `name`.
asGhostAvatarElement"span"NoRoot host.
namestring—NoInitials source and default `alt`.
srcstring—NoImage URL. Load is confirmed after mount on the client.

Emits ​

None declared.

Models ​

None declared.

Slots ​

NameDescription
fallbackShown when the image is not displayed.

Slot props: fallback ​

None declared.

Exposed members ​

NameTypeDescription
elementHTMLElement | nullThe root host element after mount, or `null` before mount.

Parts and data attributes ​

AttributeValueDescription
data-partrootNative span or div host when using the default as prop.
data-partimageimg element when the src load succeeded.
data-partfallbackInner host for initials or fallback slot content.
data-stateloadingsrc is set and the client has not finished probing yet.
data-stateloadedsrc loaded and the img is shown.
data-stateerrorsrc failed to load; fallback is shown.

CSS variables ​

None declared.

Accessibility ​

Role: generic. APG pattern: https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/.

Required ARIA attributes: none.

Keyboard ​

KeyActionAutomated browser test
TabDoes not land on the avatar unless the consumer adds tabindex.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 ​

avatar/basic ​

Example source

Initials Headless

Fallback initials from name without an image URL.

JD

avatar/composable ​

Example source

Composable Headless

Same contract as GhostAvatar, applied to a native host.

SL

avatar/fallback ​

Example source

Fallback slot Headless

Custom fallback when src is missing or fails to load.

avatar/image ​

Example source

Loaded image Headless

Client image probe after SSR-safe loading fallback.

IS

avatar/themed ​

Example source

Themed

Size hooks on the @ghostvue/themes wrapper.

AKBOCN