Skip to content

GhostToast reference ​

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

Themed toast stack: a themed GhostToastViewport that positions the portaled region as a fixed bottom-end stack and renders each record as a themed GhostToast, plus the themed GhostToast root with variant and tone hooks and enter-only motion. Provider, title, description, action, close, and useGhostToast are re-exported from @ghostvue/vue; all timers, queueing, announcements, and focus behavior stay on the headless parts.

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

All component references

Props ​

NameTypeDefaultRequiredDescription
toastGhostToastRecord—YesRecord to render, usually one item of the viewport's toasts.
variant'surface' | 'solid'"surface"NoVisual treatment. The default omits data-variant.
tone'neutral' | 'accent' | 'danger'—NoSemantic color intent. When unset, type 'error' maps to danger and other records to neutral. Neutral omits data-tone.

Emits ​

None declared.

Models ​

None declared.

Slots ​

NameDescription
defaultToast content: title, description, action, and close parts.

Slot props: default ​

NameTypeDescription
dismiss() => voidDismisses this toast.
toastGhostToastRecordThe rendered record.

Exposed members ​

NameTypeDescription
elementHTMLElement | nullDelegates to the unstyled GhostToast root.

Parts and data attributes ​

AttributeValueDescription
data-partviewportFixed bottom-end stack with .ghost-toast-viewport; data-inline (portal false) keeps it in normal flow.
data-partrootElevation-3 toast surface with .ghost-toast; plays the enter animation once on insert.
data-parttitleSemibold primary line.
data-partdescriptionMuted supporting copy.
data-partactionCompact outlined action button with a focus ring.
data-partcloseCompact icon-only dismiss button with a focus ring.
data-statetonedata-tone='accent' | 'danger' tints the surface; solid fills it.
data-statevariantdata-variant='solid' fills the toast with the tone color.

CSS variables ​

NameDescription
--ghost-motion-enter-durationEnter animation duration. No animation under prefers-reduced-motion.
--ghost-motion-translateEnter animation travel distance.
--ghost-elevation-3-bgToast surface background.

Accessibility ​

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

Required ARIA attributes: none.

Keyboard ​

None declared.

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 ​

toast/themed ​

Example source

Save and retry

Themed stack from @ghostvue/themes: Save draft shows an informational toast that dismisses itself, and Sync files shows a persistent danger error whose Retry updates the same toast in place and announces the new text.