Feedback

Toasts for transient notifications

Toasts acknowledge background work—saved settings, queued jobs, or soft failures—without modal interruption. Integrate them in React apps and Next.js client islands that own global providers.

Examples

Compact size for lightweight confirmations.


Toast variants examples

Each row shows the hook call that matches the button you click, with a Variant: line naming the toast tokens.





























CSS variable overrides

Toast CSS variables

Override these toast variables on :root, a theme selector, or a component wrapper.

116 variables

Pattern: --zui-<component>-<slot?>-<variant?>-<property>-<state?>-dark?

:root {
  --zui-toast-root-bg: oklch(98.4% 0.003 247.858);
  --zui-toast-root-fg: oklch(20.8% 0.042 265.755);
  --zui-toast-root-shadow: 0 8px 24px rgba(15,23,42,0.12);
  --zui-toast-root-default-bg: oklch(12.9% 0.042 264.695);
  --zui-toast-root-default-fg: oklch(98.4% 0.003 247.858);
  --zui-toast-root-success-border: oklch(69.6% 0.17 162.48 / 0.4);
  --zui-toast-root-success-bg: oklch(26.2% 0.051 172.552);
  --zui-toast-root-success-fg: oklch(97.9% 0.021 166.113);
  --zui-toast-root-warning-border: oklch(76.9% 0.188 70.08 / 0.4);
  --zui-toast-root-warning-bg: oklch(27.9% 0.077 45.635);
  --zui-toast-root-warning-fg: oklch(98.7% 0.022 95.277);
  --zui-toast-root-error-border: oklch(64.5% 0.246 16.439 / 0.5);
  --zui-toast-root-error-bg: oklch(27.1% 0.105 12.094);
  --zui-toast-root-error-fg: oklch(96.9% 0.015 12.422);
  --zui-toast-root-info-border: oklch(68.5% 0.169 237.323 / 0.4);
  --zui-toast-root-info-bg: oklch(29.3% 0.066 243.157);
  --zui-toast-root-info-fg: oklch(97.7% 0.013 236.62);
  --zui-toast-root-ghost-border: transparent;
  --zui-toast-root-ghost-bg: transparent;
  --zui-toast-root-ghost-fg: oklch(20.8% 0.042 265.755);
  --zui-toast-root-purple-border: oklch(43.8% 0.218 303.724);
  --zui-toast-root-purple-bg: oklch(29.1% 0.149 302.717);
  --zui-toast-root-purple-fg: oklch(97.7% 0.014 308.299);
  --zui-toast-root-pink-border: oklch(45.9% 0.187 3.815);
  --zui-toast-root-pink-bg: oklch(28.4% 0.109 3.907);
  --zui-toast-root-pink-fg: oklch(97.1% 0.014 343.198);
  --zui-toast-root-orange-border: oklch(47% 0.157 37.304);
  --zui-toast-root-orange-bg: oklch(26.6% 0.079 36.259);
  --zui-toast-root-orange-fg: oklch(98% 0.016 73.684);
  --zui-toast-root-yellow-border: oklch(47.6% 0.114 61.907);
  --zui-toast-root-yellow-bg: oklch(28.6% 0.066 53.813);
  --zui-toast-root-yellow-fg: oklch(98.7% 0.026 102.212);
  --zui-toast-root-teal-border: oklch(43.7% 0.078 188.216);
  --zui-toast-root-teal-bg: oklch(27.7% 0.046 192.524);
  --zui-toast-root-teal-fg: oklch(98.4% 0.014 180.72);
  --zui-toast-root-indigo-border: oklch(39.8% 0.195 277.366);
  --zui-toast-root-indigo-bg: oklch(25.7% 0.09 281.288);
  --zui-toast-root-indigo-fg: oklch(96.2% 0.018 272.314);
  --zui-toast-root-emerald-border: oklch(43.2% 0.095 166.913);
  --zui-toast-root-emerald-bg: oklch(26.2% 0.051 172.552);
  --zui-toast-root-emerald-fg: oklch(97.9% 0.021 166.113);
  --zui-toast-root-gray-border: oklch(27.8% 0.033 256.848);
  --zui-toast-root-gray-bg: oklch(13% 0.028 261.692);
  --zui-toast-root-gray-fg: oklch(98.5% 0.002 247.839);
  --zui-toast-root-amber-border: oklch(47.3% 0.137 46.201);
  --zui-toast-root-amber-bg: oklch(27.9% 0.077 45.635);
  --zui-toast-root-amber-fg: oklch(98.7% 0.022 95.277);
  --zui-toast-root-violet-border: oklch(43.2% 0.232 292.759);
  --zui-toast-root-violet-bg: oklch(28.3% 0.141 291.089);
  --zui-toast-root-violet-fg: oklch(96.9% 0.016 293.756);
  --zui-toast-root-gradient-blue-border: oklch(42.4% 0.199 265.638);
  --zui-toast-root-gradient-blue-from: oklch(97% 0.014 254.604);
  --zui-toast-root-gradient-blue-to: oklch(97.7% 0.014 308.299);
  --zui-toast-root-gradient-green-border: oklch(44.8% 0.119 151.328);
  --zui-toast-root-gradient-green-from: oklch(98.2% 0.018 155.826);
  --zui-toast-root-gradient-green-to: oklch(98.6% 0.031 120.757);
  --zui-toast-root-gradient-red-border: oklch(44.4% 0.177 26.899);
  --zui-toast-root-gradient-red-from: oklch(97.1% 0.013 17.38);
  --zui-toast-root-gradient-red-to: oklch(97.1% 0.014 343.198);
  --zui-toast-root-gradient-yellow-border: oklch(47.6% 0.114 61.907);
  --zui-toast-root-gradient-yellow-from: oklch(98.7% 0.026 102.212);
  --zui-toast-root-gradient-yellow-to: oklch(98% 0.016 73.684);
  --zui-toast-root-gradient-purple-border: oklch(43.8% 0.218 303.724);
  --zui-toast-root-gradient-purple-from: oklch(97.7% 0.014 308.299);
  --zui-toast-root-gradient-purple-to: oklch(97.1% 0.014 343.198);
  --zui-toast-root-gradient-teal-border: oklch(43.7% 0.078 188.216);
  --zui-toast-root-gradient-teal-from: oklch(98.4% 0.014 180.72);
  --zui-toast-root-gradient-teal-to: oklch(98.4% 0.019 200.873);
  --zui-toast-root-gradient-indigo-border: oklch(39.8% 0.195 277.366);
  --zui-toast-root-gradient-indigo-from: oklch(96.2% 0.018 272.314);
  --zui-toast-root-gradient-indigo-to: oklch(97.7% 0.014 308.299);
  --zui-toast-root-gradient-pink-border: oklch(45.9% 0.187 3.815);
  --zui-toast-root-gradient-pink-from: oklch(97.1% 0.014 343.198);
  --zui-toast-root-gradient-pink-to: oklch(96.9% 0.015 12.422);
  --zui-toast-root-gradient-orange-border: oklch(47% 0.157 37.304);
  --zui-toast-root-gradient-orange-from: oklch(98% 0.016 73.684);
  --zui-toast-root-gradient-orange-to: oklch(97.1% 0.013 17.38);
}

/* Dark theme variables follow the same names with -dark appended. */
.dark {
  --zui-toast-root-fg-dark: oklch(98.4% 0.003 247.858);
  --zui-toast-root-shadow-dark: 0 18px 48px rgba(15,23,42,0.45);
  /* ...same variables with -dark at the end */
}

What it does

Limit concurrent toasts and preserve reading order for screen readers.

Provide action buttons sparingly to reduce accidental clicks.

Composition and API

Prefer compound subcomponents instead of one oversized prop bag. Export a small, documented API for your design system.

Never rely solely on toasts for critical legal consent.

Common use cases

  • Confirm CRUD actions after server mutations.
  • Surface copy-to-clipboard success.
  • Notify when async exports finish.
  • Warn about connectivity retries.

Accessibility

Keyboard order, focus rings, and ARIA attributes should match production usage. Test with your supported browsers and assistive technologies when semantics are non-trivial.

This preview page exposes a single h1 in the hero for a clean outline.

Next.js integration notes

Colocate examples under the App Router, keep server and client boundaries explicit, and avoid pulling interactive overlays into unexpected server layouts.

Set NEXT_PUBLIC_SITE_URL so canonical and Open Graph URLs resolve on deploy.

FAQ

Does the Toast component work with Next.js App Router?

Yes. Import it like any other React component; keep interactive subtrees in client components when you need hooks or browser APIs, and leave static structure in server components where possible.

Can I customize toast with Tailwind CSS?

Zentauri UI exposes class-friendly variants and slots so you can extend styles with Tailwind utilities without fighting inline styles.

Is this Toast implementation accessible by default?

Primitives follow sensible defaults, but accessibility depends on how you label controls, manage focus, and wire keyboard handlers in your app. Validate critical flows with keyboard-only use and screen readers.