Notification Stack

Notifications that fan out, dismiss and restore

A compact notification center whose cards stack at rest and fan into a readable list on hover, focus or tap. Individual items can be dismissed and restored, with semantic tones and polite live announcements built in.

Preview

  1. Build finished

    Production is ready to review.

Installation

Install the component using the CLI.

npx shadcn@latest add https://rohan.run/r/notification-stack.json

Usage

Import the component:

import { NotificationStack } from "@/components/rohan/notification-stack"

Use it in your code:

<NotificationStack
  label="Recent activity"
  notifications={notifications}
  onDismiss={(notification) => archive(notification.id)}
  onVisibleChange={setVisibleNotifications}
/>

Props

PropertyTypeDefaultDescription
notificationsNotificationStackItem[]Items with titles, descriptions, timestamps, tones and optional actions.
expanded / defaultExpandedbooleanfalseControlled or initial expanded state.
maxCollapsednumber4Maximum number of cards represented in the collapsed stack.
onDismiss(notification) => voidCalled after an individual notification is dismissed.
onRestore(notifications) => voidCalled when dismissed items are restored.
live"off" | "polite" | "assertive""polite"Live-region politeness for incoming and dismissal announcements.
Components