Components
Components
Toast
Motion-aware notification stack with global provider.
newfree
Install
@hewnui/ui · hewnui
Toasts stack from the corner with a tone well, lifetime bar, and dismiss
control. Tones: default, success, danger, warning, and info.
Reduced motion softens entrance and freezes the lifetime bar.
Usage
Wrap the app with ToastProvider once — already included in the docs shell.
Tones
| Tone | Use |
|---|---|
default | Neutral status |
success | Completed save or sync |
danger | Failure that needs attention |
warning | Soft risk or quota pressure |
info | Tip or non-blocking guidance |
Accessibility
dangertoasts renderrole="alert"witharia-live="assertive"; every other tone usesrole="status"witharia-live="polite", so routine confirmations never interrupt- The dismiss control is a real button labelled "Dismiss notification"
- The countdown bar is
aria-hiddenand freezes when motion is off - Toasts auto-dismiss after 4200ms by default. Raise
durationfor longer messages, and do not put an action's only affordance inside a toast — the timer does not pause on hover or focus.
A toast is the wrong home for anything the user must act on. For blocking errors or decisions, use an inline message or a Dialog, which stay on screen until dismissed.
API reference
Props for Toast from @hewnui/ui/toast. Generated from component types — not hand-written.
Prop
Type