Toast
A succinct message that is displayed temporarily.
Installation
npm i @huin-core/react-toastAPI Reference
Toaster
| Prop | Type | Default | Description |
|---|---|---|---|
| position | "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | bottom-right | Where the toast stack is anchored in the viewport. |
| richColors | boolean | — | Applies type-specific accent colors (success, error, warning, info) instead of the neutral default. |
| closeButton | boolean | — | Shows a dedicated close button on every toast. |
| expand | boolean | — | Keeps the full stack expanded instead of collapsing extra toasts behind the front one. |
| duration | number | — | Time in milliseconds a toast stays visible before closing itself. Applies to every toast under the provider unless one overrides it. |
| hotkey | string | — | The key combination that moves focus to the toast viewport, given as an array of event.code values. |
| gap | number | — | Spacing in pixels between stacked toasts. |
| visibleToasts | number | — | Maximum number of toasts shown at once before older ones collapse behind the stack. |
Keyboard Interactions
| Key | Description |
|---|---|
F8 | Moves focus to the toast viewport. |
Tab | Moves focus through the toast's own controls. |
Esc | Dismisses the focused toast. |