Skip to main content

Toaster

Storybook​

Go to Story

toast​

const toast: typeof sonnerToast;

Defined in: src/components/Toaster/Toaster.tsx:40

A thin wrapper around the Sonner toast function that preserves the original API while customizing the default behavior for error toasts.

Example​

toast('Saved successfully');
toast({ title: 'Saved', description: 'Your changes were saved.' });
toast.error('Failed to save'); // displays for 5000ms by default
toast.error('Failed to save', { duration: 3000 }); // overrides default duration

Toaster()​

function Toaster(props): Element;

Defined in: src/components/Toaster/Toaster.tsx:22

Toaster context provider.

Parameters​

ParameterType
propsToasterProps

Returns​

Element