Toast

Notification toast system. Wrap app in ToastProvider and use the useToast() hook to show messages.

Preview

Usage

import { ToastProvider, useToast } from '@ramtt/ui'

// In root layout:
<ToastProvider>{children}</ToastProvider>

// In any component:
const toast = useToast()
toast({ message: 'Saved!', variant: 'success' })

Props

PropTypeDefaultDescription
message*stringToast text
variant'default' | 'success' | 'error' | 'warning'Toast style
durationnumber4000Auto-dismiss time in ms
action{ label: string; onClick: () => void }Action button