A stacked notification queue: newest first, capped depth, auto-dismiss timers, and four corner positions.
StackedAuto-dismissManual dismiss
const toaster = createToaster();toaster.push({ title: 'Saved', tone: 'success' });<Toaster {toaster} position="top-right" />Installation
pnpm add @chanrg/4uiImport the stylesheet once, at the root of your app:
import '@chanrg/4ui/styles.css';Usage
import { Toaster } from '@chanrg/4ui';const toaster = createToaster();toaster.push({ title: 'Saved', tone: 'success' });<Toaster {toaster} position="top-right" />API reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
toaster | ReturnType<typeof createToaster> | required | Queue instance; push()/dismiss()/clear(). |
position | top-right | top-left | bottom-right | bottom-left | top-right | Stack corner. |
CSS variables
| Variable | Description |
|---|---|
--4ui-surface | Primary component surface. |
--4ui-text | Primary foreground color. |
--4ui-border | Default control and panel border. |
Accessibility
- The stack is an aria-live region; items announce politely.
- Every toast keeps a labelled dismiss button.