npm install @thrivecart/uiyarn add @thrivecart/uipnpm add @thrivecart/uibun add @thrivecart/uiAdd the <Toaster /> component to your app layout, then use the toaster utility to trigger notifications:
import { Toaster, toaster } from '@thrivecart/ui';
// In your layout
<Toaster />
// Trigger toasts anywhere
toaster.success('Campaign published successfully');
toaster.error('Failed to send email');
toaster.info('New contacts imported');
toaster.warning('Approaching storage limit');
toaster.loading('Sending emails...');Different toast types for different contexts
<div className="flex flex-wrap gap-2">
<Button onClick={() => toaster.success('Saved successfully')}>Success</Button>
<Button onClick={() => toaster.error('Something went wrong')}>Error</Button>
<Button onClick={() => toaster.info('3 new contacts imported')}>Info</Button>
<Button onClick={() => toaster.warning('Storage almost full')}>Warning</Button>
</div>Toast messages should be 1 short sentence. Users scan them quickly.
Match the toast variant to the message type (success, error, info, warning).
If the error blocks the user's workflow, use an Alert or Dialog instead.
Limit visible toasts to 3-5. Too many notifications overwhelm users.
aria-live="polite".