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

PropTypeDefaultDescription
variant"default" | "success" | "error" | "warning" | "info""default"Visual style of the toast
titlestringTitle text for the toast
descriptionstringDescription text for the toast
durationnumber5000Time in ms before auto-dismiss (0 = never)
actionReactNodeOptional action button

Related Components