AcheryWorkshop
Overlays

Toast

Imperative toast notifications. Wrap your app in ToastProvider once, then call useToast().toast() anywhere in the tree to fire a notification. Toasts auto-dismiss after duration ms (default 4000); pass duration: 0 for persistent toasts. Renders into a portal.

Examples

Loading examples…

API

From COMPONENTS.md.

Imperative notification system, portaled to document.body.

// Wrap tree once (inside AcheryProvider)
import { ToastProvider, useToast } from 'achery-ui'
<ToastProvider>{children}</ToastProvider>

// Anywhere in the tree
const { toast } = useToast()
toast({ title: 'Saved.' })
toast({ title: 'Error', description: 'Detail', duration: 0, action: <Button>Retry</Button> })

duration: 0 keeps the toast on screen until dismissed.