Skip to content
Feedback

Toast

A notification that appears at the edge of the viewport and dismisses itself. Built on Sonner. The <Toaster /> component has to be in your root layout or nothing renders.

Trigger Toasts

Import

import {
  Toaster,
  toast,
} from "@mikenotthepope/substrateui"

API Reference

PropTypeDefaultDescription
toast(message)functionShows a default toast notification with the given message string.
toast.success(message)functionShows a success toast with a green check icon.
toast.error(message)functionShows an error toast with a red icon.
toast.warning(message)functionShows a warning toast with a yellow icon.
toast.info(message)functionShows an informational toast with a blue info icon.
descriptionstringOptional description passed as second argument options: toast('Title', { description: '...' }).