---
title: "Notification Stack | Free React & Tailwind Blocks Component | Motion UI"
canonical: "https://blacknest.dev/motion/c/blocks/notification-stack"
github_source: "https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/notification-stack.tsx"
install_command: "npx motion-ui-skill add notification-stack"
dependencies: ["clsx","lucide-react","motion","react","tailwind-merge"]
category: "blocks"
subcategory: "motion"
---

# Notification Stack

> Compact notification cards that spring from a stacked summary into a readable list on hover, focus or tap.

## Install

```bash
npx motion-ui-skill add notification-stack
```

## Dependencies

- `clsx`
- `lucide-react`
- `motion`
- `react`
- `tailwind-merge`

## Usage

```tsx
"use client";

import { RotateCw } from "lucide-react";
import {
  NotificationStack,
  type NotificationStackItem,
} from "@/components/motion/notification-stack";

const notifications: NotificationStackItem[] = [
  {
    id: "import-failed",
    title: "Orders import failed",
    description: "42s · TimeoutError at Step 2",
    trailing: (
      <span className="inline-flex items-center gap-1 text-amber-500 dark:text-amber-400">
        <RotateCw className="h-3.5 w-3.5" aria-hidden="true" />
        2
      </span>
    ),
  },
  {
    id: "sla-breach",
    title: "SLA breach",
    description: "2m 11s · Data enrichment",
  },
  {
    id: "sync-fixed",
    title: "Product sync auto-fixed",
    description: "5m · 404 on GET /products",
  },
];

export function NotificationStackPreview() {
  return (
    <div className="flex w-full items-center justify-center pt-52 pb-6">
      <NotificationStack items={notifications} />
    </div>
  );
}
```

## API Reference

### NotificationStack

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `items` | `NotificationStackItem[]` | — | Yes | — |
| `expanded` | `boolean` | — | No | — |
| `defaultExpanded` | `boolean` | `false` | No | — |
| `onExpandedChange` | `((expanded: boolean) => void)` | — | No | — |
| `onViewAll` | `(() => void)` | — | No | — |
| `maxVisible` | `number` | `3` | No | — |
| `collapsedLabel` | `string` | `Notifications` | No | — |
| `expandedLabel` | `string` | `View all` | No | — |
| `emptyLabel` | `string` | `All caught up` | No | — |
| `className` | `string` | — | No | — |
| `classNames` | `NotificationStackClassNames` | — | No | — |

## Source Files

- [components/motion/notification-stack.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/notification-stack.tsx)
- [components/motion/action-swap.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/action-swap.tsx)
- [lib/ease.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/ease.ts)
- [lib/hooks/use-dismiss.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/hooks/use-dismiss.ts)
- [lib/hooks/use-hover-gesture.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/hooks/use-hover-gesture.ts)
- [lib/hooks/use-tap-gesture.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/hooks/use-tap-gesture.ts)
- [lib/touch.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/touch.ts)
- [lib/utils.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/utils.ts)
