Skip to content

Toast

A succinct message that is displayed temporarily.

Installation

npm i @huin-core/react-toast

API Reference

Toaster

PropTypeDefaultDescription
position"top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right"bottom-rightWhere the toast stack is anchored in the viewport.
richColorsboolean—Applies type-specific accent colors (success, error, warning, info) instead of the neutral default.
closeButtonboolean—Shows a dedicated close button on every toast.
expandboolean—Keeps the full stack expanded instead of collapsing extra toasts behind the front one.
durationnumber—Time in milliseconds a toast stays visible before closing itself. Applies to every toast under the provider unless one overrides it.
hotkeystring—The key combination that moves focus to the toast viewport, given as an array of event.code values.
gapnumber—Spacing in pixels between stacked toasts.
visibleToastsnumber—Maximum number of toasts shown at once before older ones collapse behind the stack.

Keyboard Interactions

KeyDescription
F8
Moves focus to the toast viewport.
Tab
Moves focus through the toast's own controls.
Esc
Dismisses the focused toast.