Usage
Basic example
Click the button to fire a toast. Click again to stack another. The "Close all" button dismisses everything.
Provider configuration
<SnackbarProvider> accepts these props:
Per-call options
Every enqueueSnackbar call can override the provider defaults:
The full options shape lives in the API reference.
Hover behavior
Hovering anywhere on the stack pauses the auto-dismiss timer and expands the stack so the background toasts are visible. The timer resumes when you move away.
Drag to dismiss
The front toast in a stack can be swiped in the direction of the nearest screen edge to dismiss it. The dismiss direction is computed from the toast's anchorOrigin:
Drags below the threshold (100 px, or velocity > 0.4 px/ms) snap back. Drags in disallowed directions rubber-band with logarithmic damping.
Imperative close
closeSnackbar(key) dismisses a specific notification. closeSnackbar() (no argument) dismisses every notification across every anchor stack.