Toast
Timed live notifications with pause on hover or focus, keyboard dismissal, and action buttons.
A transient live notification with auto-dismiss timing, automatic pause on hover or focus, a viewport focus hotkey, and optional action triggers.
Preview
Section titled “Preview” Web Components React Vue Vue 2
Loading interactive preview… The article and source are ready to read. Interactive controls will appear here when ready.
Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases.
Compose Root, Viewport, Title, Description, Action, and Close:
- Timing and pause:
Rootstays open for5000msby default (setduration={0}to keep it open indefinitely). Hovering the toast or focusingAction/Closepauses the remaining timer until interaction leaves. - Dismissal and actions:
Close, pressingEscapewhile focused, andActionall request dismissal while leaving action side effects to your application. In controlled mode (open), timeout emits one dismissal request until the caller updatesopen. - Shortcuts and politeness:
Viewportprovides a focus shortcut (F8by default, configurable viahotkey), andpoliteness('polite'or'assertive') sets the live-region announcement priority.
| Prop | Type | Default |
|---|---|---|
defaultOpen | boolean | true |
appear | boolean | false |
enterDuration | number | 300 |
leaveDuration | number | 200 |
interrupt | 'reverse' 'wait' 'immediate' | reverse |
duration | number | 5000 |
paused | boolean | false |
politeness | 'polite' 'assertive' | polite |
Pass open to control visibility.
Part Props
Section titled “Part Props”- Viewport:
a11yLabel(default'Notifications'),hotkey(default'F8'). - Action:
disabled(defaultfalse),a11yLabel(optional). - Close:
disabled(defaultfalse). - Title, Description: No additional props.