Loading preview
Receipt Printer
AnimationsA receipt that prints out of a slot line by line, with itemized totals and a torn zig-zag edge.
Phone-style stacked notifications with frosted glass that fan out into a list on hover or click.
npx shadcn@latest add @venusui/notification-stackRun this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/ui/notification-stack.tsxThe code behind the preview above.
notification-stack-demo.tsx
import { Activity, CalendarDays, Mail, MessageCircle } from "lucide-react"
import { NotificationStack } from "@/components/ui/notification-stack"
// Wallpaper and portraits: Unsplash (free under the Unsplash License). People are made up.
const WALLPAPER = "https://images.unsplash.com/photo-1614850523459-c2f4c699c52e?w=900&h=1100&fit=crop&auto=format&q=70"
const face = (id: string) => `https://images.unsplash.com/photo-${id}?w=96&h=96&fit=crop&crop=faces&auto=format&q=80`
export default function NotificationStackDemo() {
return (
<div
className="flex w-[min(24rem,calc(100vw-3rem))] flex-col rounded-[2rem] bg-cover bg-center p-4 pt-10 pb-24 shadow-xl"
style={{ backgroundImage: `url(${WALLPAPER})` }}
>
<p className="text-center text-5xl font-light tracking-tight text-white/95 tabular-nums">9:41</p>
<p className="mb-8 text-center text-sm font-medium text-white/80">Monday, 16 November</p>
<NotificationStack
className="[&>div:first-child]:text-white"
notifications={[
{
id: "1",
app: "Messages",
title: "Priya Natarajan",
body: "Landing at 6:40! See you at arrivals? I’ll be the one with way too many bags.",
time: "now",
avatar: face("1494790108377-be9c29b29330"),
icon: <MessageCircle />,
iconClassName: "bg-emerald-500",
},
{
id: "2",
app: "Calendar",
title: "Design review",
body: "In 15 minutes · Room 4B · with Sofie and Marcus",
time: "9:45",
icon: <CalendarDays />,
iconClassName: "bg-rose-500",
},
{
id: "3",
app: "Mail",
title: "Marcus Reid",
body: "Re: Q4 launch plan. Looks great overall, one note on the pricing page before we ship.",
time: "9:12",
avatar: face("1507003211169-0a1dd7228f2d"),
icon: <Mail />,
iconClassName: "bg-sky-500",
},
{
id: "4",
app: "Fitness",
title: "Move goal reached",
body: "You closed your rings before 9 am. That’s 6 days in a row.",
time: "8:58",
icon: <Activity />,
iconClassName: "bg-orange-500",
},
]}
/>
</div>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| notifications | StackNotification[] | — | Each has id, app, title, body, time, and optionally icon, iconClassName (icon background) and avatar (a photo URL). |
| heading | string | "Notifications" | Heading above the stack. |
| expanded, defaultExpanded | boolean | — | Controlled or initial state. Unset, it fans out on hover and toggles with the button or a click. |
| onExpandedChange | (expanded: boolean) => void | — | Called when the button or a click expands or collapses it. |
All <div> props.
aria-expanded; hovering and clicking the stack are pointer shortcuts.Unknown registry "@venusui"npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.No components.json foundnpx shadcn@latest init in your project first.A receipt that prints out of a slot line by line, with itemized totals and a torn zig-zag edge.
A terminal window that types commands and prints their output when it scrolls into view.
A weather widget with a live sky: turning sun rays, drifting clouds, falling rain or snow, and twinkling stars.