Toaster
Installation
Run the following command
npx vibes@latest add toaster
Usage
'use client';import { toast } from '@/vibes/soul/primitives/toaster';function Usage() { return ( <button onClick={() => toast.success('Success', { description: 'Description of toast', action: { label: 'Undo', onClick: () => console.log('undo') }, }) } > Toast with Options </button> );}
API Reference
This component uses the Sonner toast component. For more information, please refer to the Sonner documentation.
ToastOptions
Prop | Type | Default |
---|---|---|
description | string; | |
position | 'top-left | 'top-center | 'top-right | 'bottom-left | 'bottom-center | 'bottom-right' | |
dismissLabel | string; | |
action | { label: string, onClick: () => void } |