Toast

Feedback

Temporary 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

variant"default"
"default" | "success" | "error" | "warning" | "info"

Visual style of the toast

title
string

Title text for the toast

description
string

Description text for the toast

duration5000
number

Time in ms before auto-dismiss (0 = never)

action
ReactNode

Optional action button