vael-ui v0.3.10

Feedback

Toaster

Renders the notifications created by toast(). Mount it once, anywhere in your app.

Install

import { Toaster } from 'vael-ui'

Playground

import { toast, Toaster } from 'vael-ui'

<Toaster position="bottom-right" :max-visible="4" :gap="10" />

// anywhere in your app
toast('Saved changes')
toast.success('Upload complete')

Props

NameTypeDefaultDescription
position"bottom-right" | "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center""bottom-right"
maxVisiblenumber | undefined4Max toasts shown at once; extras queue until visible slots free.
gapnumber | undefined10Spacing between stacked cards, px.
teleportTostring | undefined"body"
motionCssboolean | undefinedtrue`false` delegates enter/leave animations to `@card-enter`/`@card-leave` events.
uiPartial<{ root: UiPartValue; toast: UiPartValue; icon: UiPartValue; content: UiPartValue; title: UiPartValue; description: UiPartValue; action: UiPartValue; close: UiPartValue; }> | undefined

Slots

NameTypeDescription
default{ entry: ToastEntry; dismiss: () => void; depth: number; expanded: boolean; }Replaces a card's entire inner markup. The library still owns the <li> itself (position/stacking/swipe).

Events

NameTypeDescription
card-enter[el: Element, done: () => void]
card-leave[el: Element, done: () => void]

Exposed

NameTypeDescription
toasterElHTMLElement | null