Toast
A notification system for brief, non-blocking feedback. Use the useToast hook to trigger toasts and render the Toaster component to display them.
Variants
Click the buttons below to trigger toasts of each variant.
Async Actions
Show a loading toast that transitions to success or error after an async operation.
Custom Duration
Control how long each toast stays visible.
Real-World Actions
Common application actions with contextual toast feedback.
useToast API
The useToast() hook returns an object with the following methods:
toast.info({ title, description, duration })— Show an info toasttoast.success({ title, description, duration })— Show a success toasttoast.warning({ title, description, duration })— Show a warning toasttoast.error({ title, description, duration })— Show an error toastdismiss(id)— Dismiss a toast by its ID
Toaster Props
| Prop | Type | Default | Description |
|---|---|---|---|
position | "top-left" | "top-right" | "top-center" | "bottom-left" | "bottom-right" | "bottom-center" | "bottom-right" | The position where toasts appear on screen. |
--mantle-bg | CSS variable | theme default | Override the background color via style. e.g. style={{ "--mantle-bg": "#1a1a2e" }} |
--mantle-border | CSS variable | theme default | Override the border color via style. Set to "transparent" to remove. e.g. style={{ "--mantle-border": "#e94560" }} |
--mantle-text | CSS variable | theme default | Override the text color via style. e.g. style={{ "--mantle-text": "#ffffff" }} |
--mantle-ring | CSS variable | accent | Override the focus ring color via style. e.g. style={{ "--mantle-ring": "#e94560" }} |
position"bottom-right""top-left" | "top-right" | "top-center" | "bottom-left" | "bottom-right" | "bottom-center"The position where toasts appear on screen.
--mantle-bgtheme defaultCSS variableOverride the background color via style. e.g. style={{ "--mantle-bg": "#1a1a2e" }}
--mantle-bordertheme defaultCSS variableOverride the border color via style. Set to "transparent" to remove. e.g. style={{ "--mantle-border": "#e94560" }}
--mantle-texttheme defaultCSS variableOverride the text color via style. e.g. style={{ "--mantle-text": "#ffffff" }}
--mantle-ringaccentCSS variableOverride the focus ring color via style. e.g. style={{ "--mantle-ring": "#e94560" }}