Skip to main content

ToastProvider

Wrap your app once; provides the toast queue + renders the stack. Also carries ToastProvider.useToast.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

Wrap your app once; provides the toast queue + renders the stack.

Accessibility​

Status messages use role="status" / aria-live="polite" (or assertive for errors) so updates are announced without stealing focus.

Install and import​

npx shadcn@latest add @prism/toast-provider
import { ToastProvider } from '@/components/prism/ToastProvider';

In a no-build prototype, read it from the bundle instead: const { ToastProvider } = window.PrismDesignSystem_39d121;

Props​

PropTypeRequiredDescription
childrenReact.ReactNode—
durationnumber—Auto-dismiss delay in ms (0 to disable). Default 5000.