Toast
A toast notification system that mounts itself automatically, no provider component required. Supports loading states that resolve into success or error, action buttons, an awaitable confirm() dialog for replacing window.confirm() and one-off modals, and nested validation error lists you can click to jump straight to the broken field.
1. Interactive Playground
Configure layout variants, interaction states, and all available payload options.
2. Enterprise Integration Cookbook
Ready-to-use implementations for advanced architectural patterns.
Real Validation, via @midnight-owl/use-data-validator
The form above is live — useDataValidator runs required/email/regex/custom rules against it, and its getErrorList() output is passed straight into errorList below — no hand-authored tree to keep in sync. Sections render as collapsible branches with per-group issue counts; each leaf auto-scrolls to the matching data-validate-field input. The same validator also feeds each field's own error prop, so the toast is the summary/navigator while the fields show their errors inline — click "Save Employee Record" above to try it, fix a field, and click again.
Awaitable confirm()
confirm() centers itself, blocks dismissal, and returns a Promise that resolves to whichever button's value the user clicks -- a direct replacement for window.confirm() and one-off modals. A component can be passed the same way as a regular toast to embed a field (e.g. capturing a name) inside the dialog before it resolves. Unsaved Changes is the same primitive used for a "save or discard?" decision instead of a destructive one -- a warning worth acting on immediately is still a decision, not a routine outcome, so it belongs here rather than as a warning() shorthand with a bolted-on action button.
Async Promise Resolution
Wrap your Axios or Fetch calls natively. The toast handles the persistent loading spinner and auto-transitions to success or danger upon resolution.
Severity Shorthands
info(), success(), warning(), and error() (an alias for danger()) all forward straight to add() with their severity pre-applied -- the routine outcomes of the same employee-record flow above, without hand-rolling add({ severity: ... }) at every call site.
Loading Without a Result Toast
Omit success/error from promise() and the loading toast just closes on settle -- no result toast at all. Useful when your own UI (a Modal here) is the thing that actually shows the result.
Native Component Injection
Render completely custom interactive UI -- like this inline InputText + Button note form -- inside the Toast body by passing any valid Vue Component directly into the payload. componentProps passes the employee's name in via v-bind so the form reads it as a real prop instead of closing over an outer variable.
Explicit ID & Targeted Removal
Pass your own id in the payload instead of relying on the auto-generated one that add() returns -- lets a separate button (or a websocket event, a different component entirely) call toast.remove(id)/toast.update(id, ...) against a toast it never dispatched itself.
Toast-Level onNavigate Fallback
Every item in this errorList has canNavigate: true but no item-level onNavigate of its own (unlike the validation demo above, where useDataValidator already sets one per field) -- so every click falls through to the toast's own onNavigate callback instead of the native scroll-to-element default.
Rich HTML Parsing
Pass the html: true flag to evaluate the message (and title) string natively -- a popup-ad-style promo banner with a gradient block, a badge, and a CTA link, not just plain text.
API Reference
Complete technical specifications for the Composable Methods and Payload options.
useToast() Methods
ToastOptions Payload
ToastConfirmButton (confirm() buttons[])
confirm(options) takes the same ToastOptions payload above (minus actions/onNavigate) plus a required buttons array: