Use this file to discover Exa products, pricing, evaluations, comparisons, use cases, agent interfaces, and technical documentation before exploring further.
JavaScript toast libraries show short notification messages that appear over a page and close on their own. These libraries confirm events such as a saved setting, a sent message, or a failed upload without interrupting the page.
Popularity
Sonner has the most installs, while SweetAlert2 has the most GitHub stars.
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.
Libraries and code examples
Sonner
Sonner is a styled toast component for React, built around a Toaster component that is mounted once in the app and renders the toasts. The toast function shows one from anywhere in the code, such as toast('Saved'). Variants of that function add action buttons and loading toasts that update when a promise settles. A separate package, Vue Sonner, ports the same component to Vue and Nuxt.
Downloads / mo
226.6M
Stars
13.2K
Last release
2.0.8
License
MIT
Strengths
Compact toast stack.Toasts stack tightly and expand when someone hovers over them.
Action buttons.Add a button that runs a callback and closes the toast.
Limitations
Big restyles go headless.For a very different look, use the headless option and render custom markup.
@radix-ui/react-toast is the toast primitive from Radix, published inside the radix-ui package. Its parts, Toast.Provider, Toast.Root, Toast.Title, Toast.Action, and Toast.Viewport, ship unstyled, leaving all of the CSS to the app. Each toast closes after five seconds by default, with a timer that pauses on hover, focus, and window blur. A swipe gesture in the configured direction also dismisses a toast. Unlike Sonner, the primitive has no toast() function: each toast renders from React state through the open and onOpenChange props.
Downloads / mo
168.4M
Stars
19.5K
Last release
1.3.1
License
MIT
Strengths
Pauses on hover and focus.The close timer stops on hover, focus, and window blur.
Keyboard hotkey to toasts.A hotkey moves keyboard focus to the toast area.
Limitations
No toast() function.Render toasts from state, or write a custom imperative helper.
react-hot-toast shows toasts in React through a toast function and a Toaster component that renders them. The README puts the library under five kilobytes, with its default styles included. A promise passed to the library shows a loading toast that turns into success or error when the promise settles. For a custom design, the useToaster hook returns the toast state and leaves the markup to the app, the same split that Sonner offers in its headless option.
Downloads / mo
19.7M
Stars
11.0K
Last release
2.6.1
License
MIT
Strengths
Fits a custom design.The useToaster hook handles state, and the app renders the toasts.
Promise toasts.One call shows loading, then success or error, as the promise settles.
Limitations
Loading toasts stay open.Update or dismiss a toast.loading notification when the work finishes.
React-Toastify shows toasts in React through the toast function, after a ToastContainer component is mounted once in the app. Each toast shows a progress bar for the time left before it closes. Toasts pause when the window loses focus and close on a swipe. Settings on the container limit how many toasts appear at once, while a single toast can render any React component, update after it opens, or close from code. Right-to-left layouts, dark mode, and stacked notifications are built in.
Downloads / mo
19.6M
Stars
13.4K
Last release
11.2.0
License
MIT
Strengths
Limits visible toasts.Set how many toasts can show at the same time.
Keyboard shortcut to toasts.Alt+T focuses the first toast, then Tab moves through its controls.
Limitations
Needs a ToastContainer.Mount ToastContainer in the app before calling toast.
Vue Sonner is a Vue port of Sonner with default styles and swipe-to-dismiss. The port keeps Sonner's two parts: a Toaster component placed once, plus a toast function with variants for success, error, actions, and promises. Nuxt projects add the vue-sonner/nuxt module and call $toast from any component.
Downloads / mo
12.0M
Stars
1.5K
Last release
2.0.9
License
MIT
Strengths
Nuxt module included.Add vue-sonner/nuxt to the Nuxt modules, then call $toast in any component.
Promise toasts.One toast.promise call shows loading, then success or error.
Limitations
Import the stylesheet.Import vue-sonner/style.css alongside the Toaster component.
Notistack shows snackbars, short messages that stack on top of each other, in React. Each one starts with a call such as enqueueSnackbar('Saved') after a SnackbarProvider component is mounted. Inside that provider, the useSnackbar hook gives components the same call. From version three on, the library has no dependency on Material UI, which older versions required as a peer dependency.
Downloads / mo
10.5M
Stars
4.1K
Last release
3.0.2
License
MIT
Strengths
Caps the stack.Set maxSnack to limit how many snackbars show at once.
Blocks duplicate messages.Turn on preventDuplicate to stop the same message from showing twice.
Limitations
Needs a provider.Wrap the app in SnackbarProvider before calling the useSnackbar hook.
function MyApp() {
const { enqueueSnackbar } = useSnackbar();
const handleClick = () => {
enqueueSnackbar('I love snacks.');
};
const handleClickVariant = (variant: VariantType) => () => {
// variant could be success, error, warning, info, or default enqueueSnackbar('This is a success message!', { variant });
};
return (
<React.Fragment>
<Button onClick={handleClick}>Show snackbar</Button>
<Button onClick={handleClickVariant('success')}>Show success snackbar</Button>
</React.Fragment>
);
}
@zag-js/toast
@zag-js/toast runs toast behavior as a state machine, a model that moves each toast through a fixed set of states. Zag's adapters connect the machine to React, Solid, Vue, or Svelte, which means a React project also installs @zag-js/react. A store made with toast.createStore keeps the placement and overlap settings. Calling toaster.create adds a toast with a title, a description, and a type such as info, success, or loading. Each type has its own default duration, from two seconds for success to no limit for loading. Like @radix-ui/react-toast, the package leaves the toast markup and styles to the app.
Downloads / mo
6.8M
Stars
5.3K
Last release
1.48.0
License
MIT
Strengths
Follows promises.One toast tracks a promise from loading to its result.
Priority queue.Queued toasts wait in priority order.
Limitations
The app builds the markup.Write the toast and toaster components and their styles by hand.
SweetAlert2 replaces the browser's alert, confirm, and prompt boxes with styled popup dialogs that follow WAI-ARIA, the web standard for accessible widgets. Setting toast: true turns a popup into a small notification that leaves the page usable. Swal.mixin saves a set of options, such as toast mode, position, and timer, after which each call to fire passes only the message. The package has no dependencies of its own; integration guides for React, Angular, and Laravel are linked from its README.
Downloads / mo
4.7M
Stars
18.1K
Last release
11.26.25
License
MIT
Strengths
Reusable toast presets.Create a toast preset with Swal.mixin, then call fire for each message.
Pause the close timer.Call stopTimer to hold the current toast open.
Limitations
Toasts never take focus.Toast mode doesn't move focus or block the page.
HTML isn't sanitized.Pass untrusted messages as text, or escape them before using html.
In a React app, use Sonner: add one Toaster component, then call toast from anywhere. Choose react-hot-toast for rendering custom toast markup, and React-Toastify to limit how many toasts show at once. On a page with no framework, use SweetAlert2.
Add <Toaster /> to the app once, then call toast('Saved') from any component. Use toast.success, toast.error, or toast.promise for the common states.
The shadcn/ui toast component depends on @radix-ui/react-toast. Radix supplies unstyled, accessible toast parts, and shadcn/ui adds the styles.
Use Vue Sonner, a Vue port of Sonner that includes a Nuxt module. @zag-js/toast also has a Vue adapter for writing custom toast markup.
No. Radix Toast provides unstyled, accessible parts, and the app supplies the CSS. It still closes toasts on a timer, pauses them on hover and focus, and supports swipe to dismiss.
Use react-hot-toast to render a custom toast design, since its headless hook manages state without rendering anything. Use React-Toastify for built-in queue limits and a keyboard shortcut that focuses toasts.
For coding agents
Found your toast notification library? Help your agent use it.
Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.