Toast
FeedbackTemporary notification messages that appear and auto-dismiss. Use toasts for non-blocking feedback about completed actions or background events.
Import
import { Toast, ToastProvider, useToast } from "@/components/ui/toast";Usage
Interactive Demo
Click buttons to trigger different toast variants
Toast Variants
Static preview of toast styles
With Action
Toast with an action button
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "success" | "error" | "warning" | "info" | "default" | Visual style of the toast |
title | string | — | Title text for the toast |
description | string | — | Description text for the toast |
duration | number | 5000 | Time in ms before auto-dismiss (0 = never) |
action | ReactNode | — | Optional action button |