Skip to content
StackD
Notification stack, the StackD component

Notifications · Free

Notification stack

Notifications that stack, fan out on hover and swipe away.

Free on Gumroad: the download arrives in your inbox.

Details

Category
Notifications
Plan
Free
Code
React + Tailwind, TypeScript · 293 lines
Files
NotificationStack.tsx
Needs
React and Tailwind only
Agents
MCP server and shadcn registry

About

A stack of notifications. The newest sits in front and the older ones peek out behind. Hover (or tap, or tab in) and the pile opens into a list. Swipe one sideways to dismiss it; let go early and it springs back. Each one closes by itself after a few seconds, and the timer pauses while the stack is open. White and black versions. React + Tailwind, no other libraries. Respects reduced motion.

Install

With the shadcn CLI:

npx shadcn@latest add https://www.stackd.codes/r/notification-stack.json

Or let your agent add it through the StackD MCP server:

claude mcp add --transport http stackd https://www.stackd.codes/mcp

Prompt for your agent

Paste it into Claude Code, Cursor, Codex or VS Code once the MCP server is connected.

Add the StackD Notification stack component to this project. Use the StackD MCP server: call get_component with { "name": "notification-stack" }, write the files at the paths it gives and install any npm packages it lists. Then use it where it fits, following its README for the props, and keep its own styles.

Use

  1. Copy NotificationStack.tsx into your project (for example components/NotificationStack.tsx).
  2. Keep the list in your own state and remove the one it gives you back:
import { useState } from 'react'
import { NotificationStack, type Note } from './components/NotificationStack'

export function App() {
  const [notes, setNotes] = useState<Note[]>([])

  const notify = (note: Omit<Note, 'id'>) =>
    setNotes((list) => [...list, { ...note, id: crypto.randomUUID() }])

  return (
    <>
      <button onClick={() => notify({ title: 'Saved', body: 'Your changes are live.', time: 'now' })}>
        Save
      </button>

      <div className="fixed bottom-4 right-4 w-[360px]">
        <NotificationStack
          notes={notes}
          onDismiss={(id) => setNotes((list) => list.filter((n) => n.id !== id))}
        />
      </div>
    </>
  )
}

In Next.js the file already starts with 'use client'. In other React setups that line does nothing.

Options

PropDefaultWhat it does
notesThe list, oldest first, newest last
onDismissCalled with the id when a note is swiped, closed or times out. Remove it from your list
theme'light''light' (white notes) or 'dark' (black notes)
duration5000Milliseconds before a note closes by itself. 0 keeps them until dismissed
visible3How many show in the pile when it's folded

Each note: { id, title, body?, time?, icon?, action?: { label, onClick } }. icon takes any element, for example a coloured dot or an avatar.

Keyboard

Tab into the stack to open it. Esc, Delete or Backspace closes the focused note.

Colours from StackD

White #FFFFFF · Ink #141310 · Wine #901919 · Olive #6C8544 · Ochre #BE9344 · Lilac #C9B8FF

Licence

You can use it in personal and commercial projects. Don't resell or share the component on its own.

Made by StackD · stackd.codes

More in Notifications