Skip to content
ZikZuk UI

Toast

Stripe Toast

Stripe's toast: a compact dark bar centred at the bottom, one line of at most 30 characters. success, caution or pending (a spinner that stays until you update it). It leaves after 4 seconds, 6 with an action. Name the thing and repeat the button's verb: “Add person” → “Person added”. KitProvider mounts the Toaster for you.

pnpm add @zikzuk/ui
import { showToast } from "@zikzuk/ui";

Types

When to use

  • Confirming an action whose result is also visible on the page.

Not for

  • A server's reason — show it in a Banner.
  • Secrets — a warning Banner with Copy.

Props

PropTypeDescription
messagestring1–30 characters, never empty.
type"success" | "caution" | "pending"Omit for a plain note.
action / onActionstring / () => voidOne action, such as Retry.
returns{ update(message, options), dismiss() }Turn a pending toast into success or caution.