Components
- Accordion
- Add to Cart
- Animated List
- Carousel
- Collapsible Sidebarnew
- Dynamic Island
- Expandable Cardnew
- Expanding Searchnew
- Filter Grid
- Kanban Board
- Layout Switcher
- Morphing Popover
- Number Flip
- Page Transition
- Product Gallery
- Segmented Control
- Sortable Table
- Stack Navigator
- Status Button
- Step Wizard
- Tabs
- Text Morphnew
- Theme Mode Switch
- Theme Morph Button
- Theme Toggle Button
- Theme Toggle Switch
- Theme Transition
- Toast Stacknew
Installation
$ pnpm dlx shadcn@latest add @transition-kit/toast-stackUsage
import {
ToastProvider,
ToastViewport,
useToast,
} from "@/components/transitions/toast-stack";<ToastProvider>
<App />
<ToastViewport className="fixed right-4 bottom-4 z-50" />
</ToastProvider>const { toast, dismiss } = useToast();
const id = toast({
title: "Deploy finished",
description: "Production is live at v2.14.0.",
});
dismiss(id); // one toast
dismiss(); // all toastsToasts dismiss themselves after duration. Hovering or focusing the stack pauses the timers.
API Reference
ToastProvider
| Prop | Type | Default | Description |
|---|---|---|---|
limit | number | 3 | Most toasts on screen. The oldest leaves first. |
duration | number | 4000 | Default milliseconds before a toast dismisses itself. |
toast(options)
| Option | Type | Default | Description |
|---|---|---|---|
title | ReactNode | - | Toast heading. |
description | ReactNode | - | Secondary text. |
action | ReactNode | - | An extra control, e.g. an Undo button. |
duration | number | provider's | Milliseconds before closing. Infinity stays. |
Returns the toast's id.