toast playground
Concurrent notifications with independent ID-keyed expiry, manual dismissal, and polite or urgent announcements.
Preview
Example controls
State matrix
| Variant | Default |
|---|---|
| Sample |
Published example
API reference'use client'
import { Button, ToastProvider, ToastViewport, useToast } from '@ancrel/ui'
import '@ancrel/tokens/css'
import '@ancrel/ui/styles.css'
function SaveAction() {
const { push } = useToast()
return <Button onClick={() => push({ message: 'Draft saved', tone: 'success' })}>Save draft</Button>
}
export default function App() {
return <ToastProvider durationMs={4500}><SaveAction /><ToastViewport /></ToastProvider>
}