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.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
toast | GhostToastRecord | — | Yes | Record to render, usually one item of the viewport's toasts. |
variant | 'surface' | 'solid' | "surface" | No | Visual treatment. The default omits data-variant. |
tone | 'neutral' | 'accent' | 'danger' | — | No | Semantic 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
| Name | Description |
|---|---|
default | Toast content: title, description, action, and close parts. |
Slot props: default
| Name | Type | Description |
|---|---|---|
dismiss | () => void | Dismisses this toast. |
toast | GhostToastRecord | The rendered record. |
Exposed members
| Name | Type | Description |
|---|---|---|
element | HTMLElement | null | Delegates to the unstyled GhostToast root. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | viewport | Fixed bottom-end stack with .ghost-toast-viewport; data-inline (portal false) keeps it in normal flow. |
data-part | root | Elevation-3 toast surface with .ghost-toast; plays the enter animation once on insert. |
data-part | title | Semibold primary line. |
data-part | description | Muted supporting copy. |
data-part | action | Compact outlined action button with a focus ring. |
data-part | close | Compact icon-only dismiss button with a focus ring. |
data-state | tone | data-tone='accent' | 'danger' tints the surface; solid fills it. |
data-state | variant | data-variant='solid' fills the toast with the tone color. |
CSS variables
| Name | Description |
|---|---|
--ghost-motion-enter-duration | Enter animation duration. No animation under prefers-reduced-motion. |
--ghost-motion-translate | Enter animation travel distance. |
--ghost-elevation-3-bg | Toast 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.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Not reviewed | No declared key is mapped to a browser test yet. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
toast/themed
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.