Menu

Toast

Transient notification. 4 types × 2 themes.

Darjeeling tin added to your cart.

Installation

$ npx uix-ui@latest add toast

This copies the file into components/ui/toast.tsx in your project. npx shadcn@latest add @uix/toast works too.

Usage

toast.tsx
import { Toast } from "@/components/ui/toast";

<Toast action={<Button size="sm" variant="ghost">Undo</Button>}>Darjeeling tin added to your cart.</Toast>

Examples

Types and themes

Saved to your wishlist.
Order placed. Thank you, Nusrat!
Only 2 tins left in stock.
We could not reach bKash. Try again.
Dark toast: parcel delivered.

Dismissing

Sylhet green added.
Masala chai added.

Props

PropTypeDefaultDescription
themelight | dark"light"
typedefault | success | warning | error"default"
actionReact.ReactNode–Button or link on the right, for example an Undo action.

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
  • components/ui/icons.tsx
esc

↑↓ to navigate · ↵ to select · esc to close