# Notification Stack

Stacked notifications that fan out on hover and swipe away, built with React and Tailwind CSS.

Install with

```
npx shadcn@latest add https://kokonutui.com/r/notification-stack.json
```

then show me how to use it.

## Installation

Notification Stack is a free, open-source React component in the Kokonut UI [Cards collection](/content/docs/cards/index.html). Add it with the shadcn CLI, which copies the source into `components/kokonutui/notification-stack.tsx`, so the code is yours to change.

Or add it by hand: install its packages, then copy the source from above into `components/kokonutui/notification-stack.tsx`.

```
npm install lucide-react
```

## Usage

```
import NotificationStack from "@/components/kokonutui/notification-stack";

export default function Example() {
  return <NotificationStack />;
}
```

## Props

- `notifications`  
  `StackNotification[]` Default `built-in`  
  Initial notifications, newest first. The stack tracks dismissals itself.

- `onDismiss`  
  `(id: string) => void`  
  Called after a notification has been swiped or clicked away.

- `className`  
  `string`  
  Extra classes for the root element.

### StackNotification

| Property | Required | Type   |
| -------- | -------- | ------ |
| `id`    | Yes      | `string` |
| `app`   | Yes      | `string` |
| `title` | Yes      | `string` |
| `body`  | Yes      | `string` |
| `time`  | Yes      | `string` |
| `icon`  | No       | `ReactNode` |

## Dependencies

| Needs                       | Version  | Comes from                       |
| --------------------------- | -------- | -------------------------------- |
| `lucide-react`             | `^0.556.0` | npm, installed by the CLI      |
| `cn` from `lib/utils.ts`  |          | shadcn init                     |
| React                      | `^19`   | Your app                        |
| Tailwind CSS               | `^4`    | Your app                        |

No provider, font or global CSS to set up: the file works as soon as it lands.
