动效消息通知栈

堆叠式消息通知,支持状态变形、滑动关闭、操作按钮以及感知布局的动效。

Open a real toast

Toasts render fixed on the screen. Change position to open a toast from that edge.

安装

用 shadcn CLI 添加,或手动复制源码。

$ bunx --bun shadcn add @uilab/animated-toast-stack

API 参考

useAnimatedToastStack

initialToasts?
ToastInput[]
[]
defaultDuration?
number
4200
limit?
number

AnimatedToastStack

toasts
AnimatedToast[]
onDismiss?
((id: string) => void)
position?
"top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right"
bottom-right
placement?
"static" | "fixed" | "absolute"
fixed?
boolean
false
portal?
boolean
portalRoot?
Element | null
maxVisible?
number
4
className?
string
classNames?
ToastClassNames
icons?
Partial<Record<ToastStatus, ReactNode>>
renderToast?
((toast: AnimatedToast) => ReactNode)

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.