Dinachi

Toast

A succinct message displayed temporarily to provide feedback about an action. Supports multiple variants and auto-dismiss.

#Installation

npx @dinachi/cli@latest add toast

#Usage

tsx
import { Toast, ToastProvider, ToastViewport, ToastRoot, ToastTitle, ToastDescription, ToastAction, ToastClose, useToastManager } from '@/components/ui/toast'

#Examples

Default Toast

A basic toast notification

Toast Variants

Different toast variants and types

#API Reference

PropTypeDefaultDescription
variant'default' | 'destructive' | 'success' | 'warning' | 'loading''default'The visual style variant of the toast
limitnumber3The maximum number of toasts displayed at once
timeoutnumber5000The duration in milliseconds before the toast auto-dismisses
swipeDirectionArray<'up' | 'down' | 'left' | 'right'>['down', 'right']The directions in which the toast can be swiped to dismiss
titlestringThe title text of the toast
descriptionstringThe description text of the toast