Skip to content
Eskais UI

Feedback

Toast

UI SDK toasts: ToastStack renders a styled, announced region with a tone icon per type; toast() and createToaster() add toasts with actions, cancel and timed dismissal.

Example

Installation

npx shadcn@latest add @eskais/toast
npm packagesclass-variance-authority@0.7.1lucide-react

Usage

Import
import {  Toast,  ToastAction,  ToastClose,  ToastDescription,  ToastIcon,  ToastRegion,  ToastStack,  ToastTitle,  createToaster,  toast,  toastTone,} from "@/components/ui/toast"

API reference

ToastRegion

PropTypeDefault
hoverDelayHow long the pointer has to rest on the toasts, in ms, before their timers pause. Focus pauses them at once.number300

Also takes every prop of UI SDK ToastRegion.

Toast

PropTypeDefault
toneWhat the toast means. Defaults to the tone of its type, so `toast.error()` reads as destructive.Tone–

Also takes every prop of UI SDK Toast.

ToastAction

Takes every prop of UI SDK ToastAction except aria-label, ButtonLookProps.

ToastClose

Takes every prop of UI SDK ToastClose except aria-label, ButtonLookProps.

ToastIcon

PropTypeDefault
typeThe toast's type: `loading` shows a spinner, and the others the icon of their tone.ToastType"default"
toneOverrides the tone of the type. `neutral` and `violet` have no icon.Tone–

Also takes <span> attributes except children.

ToastStack

PropTypeDefault
hoverDelayHow long the pointer has to rest on the toasts, in ms, before their timers pause. Focus pauses them at once.number–
labelsAccessible names, in the page's language.Partial<ToastStackLabels>–
closeLabel@deprecated Use `labels.close`.string–

Also takes every prop of UI SDK ToastRegion except children.

Other exports

createToastertoasttoastTonetype ToastIconPropstype ToastPropstype ToastRegionPropstype ToastStackLabelstype ToastStackProps

Accessibility

  • An announced region in the top layer; actions are real buttons and toasts pause on hover and focus.

Agent actions

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.