Toast
Brief, non-blocking notifications triggered imperatively with `toast()`.Types
Preview
Code
Installation
Package
CLI (copy source)
pnpm
pnpm add @advui/corenpm
npm install @advui/coreUsage
import { toast } from '@advui/core'
toast.success('Profile saved', { description: 'Your changes are live.' })Examples
With action
Preview
Code
API reference
toast(title, options?)
Also `toast.success / error / warning / info / loading / promise / dismiss`.| Prop | Type | Default | Description |
|---|---|---|---|
description | ReactNode | — | Secondary text. |
duration | number | 4000 | Milliseconds before auto-dismiss. |
action | { label: string; onClick: () => void } | — | Inline action button (e.g. Undo). |
dismissible | boolean | true | Shows the close button and allows swipe. |
Toaster
Rendered automatically by UniversalProvider; configure with its `toaster` prop.| Prop | Type | Default | Description |
|---|---|---|---|
position | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'bottom-right' | Screen corner. |
duration | number | 4000 | Default duration. |
visibleToasts | number | 4 | Maximum stacked toasts. |
Accessibility
- Toasts live in a labelled “Notifications” region and are announced politely.
- Pause-on-hover/focus prevents toasts from disappearing while being read; Alt+T focuses the region.
- Don’t put the only path to an action in a toast — it disappears.
- Swipe to dismiss on touch; reduced motion disables slide animations.
| Key | Action |
|---|---|
| Alt + T | Moves focus to the notifications region. |
| Tab | Moves through toast actions. |
Platform notes
Web
Stacked in the chosen corner; hover expands the stack.
iOS
Rendered in-app with swipe-to-dismiss.
Android
Rendered in-app with swipe-to-dismiss. With
androidRipple (on in material()), presses show the native ripple.