Sonner

Stackable, swipeable toast notifications. Built on the sonner library; skinned with Tidal tokens. Prefer over Toast for most notification needs — richer API, auto-stacking, promise support.

Default

import { toast } from "@tidal-ds/react";

toast("Event has been scheduled", {
  description: "Sunday, December 03, 2023 at 9:00 AM",
});

Success

toast.success("Changes saved", {
  description: "Your preferences have been updated.",
});

Error

toast.error("Couldn't save changes", {
  description: "Check your connection and try again.",
});

With action

toast("Event has been scheduled", {
  description: "Sunday, December 03, 2023 at 9:00 AM",
  action: {
    label: "Undo",
    onClick: () => toast("Scheduling reverted"),
  },
});

Props

Component / APINotable props
Toasterposition ("bottom-right" | "top-right" | "bottom-center" | …), theme ("light" | "dark" | "system"), richColors, closeButton, expand, visibleToasts, duration, offset, …
toast()title (string | ReactNode), options: { description, action: { label, onClick }, cancel, duration, id, icon, … }
toast.success / error / info / warning / loadingSame signature as toast(); varies the icon / accent.
toast.promise(p, { loading, success, error })Wire a toast to a Promise — swaps loading → success/error on settle.
toast.dismiss(id?)Programmatically dismiss one or all toasts.

Source

packages/react/src/components/sonner.tsx · Figma node 2819:30654