Toast

Notification system with provider, hook, variants, and optional actions.

Import/Installation

import { ToastProvider, useToast } from "@lottiefiles/creator-plugins-ui";

Preview

Usage

function Actions() {
  const { toast } = useToast();
  return <button onClick={() => toast({ title: "Saved", variant: "success" })}>Show</button>;
}

<ToastProvider>
  <Actions />
</ToastProvider>;

Props

ToastProvider

PropTypeDefaultRequiredDescription
childrenReact.ReactNodeYesProvider children.
maxToastsnumber3NoMaximum number of visible toasts.
position"top-center" | "top-right" | "top-left" | "bottom-center" | "bottom-right" | "bottom-left""bottom-right"NoPlacement of the toast viewport.

Toast

PropTypeDefaultRequiredDescription
titlestringNoPrimary toast message.
descriptionstringNoSecondary toast message.
durationnumber3000NoAuto-dismiss delay in milliseconds. Use `Infinity` for persistent toasts.
actionReact.ReactNodeNoOptional action element rendered inside the toast.
variant"default" | "success" | "error" | "warning" | "info" | "loading""default"NoVisual tone of the toast.

useToast hook

const { toast, dismiss, toasts } = useToast();

Call toast({ ... }) from anywhere inside <ToastProvider>. Returns a string id you can pass to dismiss(id) to close the toast programmatically.

Last updated: August 5, 2026 at 11:47 AMEdit this page