# Notifications Panel
URL: /docs/web/components/notifications-panel
Notifications Panel component with multiple variants and sizes.
**Demo:**
```tsx
'use client';
import { useState } from 'react';
import { NotificationsPanel } from '@docyrus/ui/components/notifications-panel';
import {
MessageSquare, Receipt, Rocket, Info, Check, X, ArrowUpRight, ArrowRight
} from 'lucide-react';
export function NotificationsPanelDemo() {
const [activeTab, setActiveTab] = useState<'all' | 'requests' | 'mentioned'>('all');
const allNotifications = [
{
id: '1',
type: 'comment' as const,
variant: 'default' as const,
icon: 'OA',
badge: ,
title: (
<>
Oğuz Aksu commented on Google
>
),
content: (
"We need to follow up on the Q3 expansion plans before the next board meeting. Can you check the latest financials?"
),
timestamp: '2m ago',
actions: [
{ label: 'Reply', variant: 'default' as const },
{
label: 'View Google',
variant: 'link' as const,
icon:
}
]
},
{
id: '2',
type: 'approval' as const,
variant: 'unread' as const,
icon: ,
title: 'Expense Approval for Q3 Travel',
subtitle: (
<>
Requested by Sarah Jenkins • $1,240.50
>
),
timestamp: '1h ago',
showUnreadIndicator: true,
actions: [
{
label: 'Approve',
variant: 'primary' as const,
icon:
},
{
label: 'Deny',
variant: 'danger' as const,
icon:
}
]
},
{
id: '3',
type: 'status' as const,
variant: 'default' as const,
icon: ,
title: 'Update status for Project Apollo',
subtitle: 'Weekly check-in required for ongoing enterprise deal.',
timestamp: '3h ago',
actions: [
{ label: 'Update Status', variant: 'default' as const },
{
label: 'View Project',
variant: 'link' as const,
icon:
}
]
},
{
id: '4',
type: 'info' as const,
variant: 'default' as const,
icon: ,
title: 'Welcome to the new workspace',
subtitle: "We've updated the dashboard to help you track your leads more efficiently. Take a quick tour to see what's new.",
timestamp: '1d ago'
}
];
const filteredNotifications = allNotifications.filter((notification) => {
if (activeTab === 'requests') {
return notification.type === 'approval' || notification.type === 'status';
}
if (activeTab === 'mentioned') {
return notification.type === 'comment';
}
return true;
});
const tabs = [
{
label: 'All Notifications',
count: allNotifications.length,
active: activeTab === 'all',
onClick: () => setActiveTab('all')
},
{
label: 'Requests',
count: allNotifications.filter(n => n.type === 'approval' || n.type === 'status').length,
active: activeTab === 'requests',
onClick: () => setActiveTab('requests')
},
{
label: 'Mentioned',
count: allNotifications.filter(n => n.type === 'comment').length,
active: activeTab === 'mentioned',
onClick: () => setActiveTab('mentioned')
}
];
return (
Mark all as read
}
tabs={tabs}
notifications={filteredNotifications}
footer={
}
onNotificationAction={(id, action) => {
console.info(`Notification ${id}: ${action}`);
}} />
);
}
```
## Installation
```bash
pnpm dlx @docyrus/cli add @docyrus/ui-notifications-panel
```
**Dependencies:**
- [class-variance-authority](https://www.npmjs.com/package/class-variance-authority)
## Usage
```tsx
import {
NotificationsPanel
} from "@docyrus/ui/components/notifications-panel";
{}}
notifications={NotificationItem[]}
footer={...}
onNotificationAction={() => {}}
/>
```
## Variants
| Variant | Description |
|---------|-------------|
| `default` | Default style |
| `elevated` | Elevated — `shadow-md` |
## Sizes
| Size | Description |
|------|-------------|
| `sm` | Small — `max-w-sm` |
| `default` | Default — `max-w-md` |
| `lg` | Large — `max-w-lg` |
| `full` | full — `w-full` |
## API Reference
| Prop | Type | Default |
|------|------|---------|
| `variant` | `"default"` \| `"elevated"` | `"default"` |
| `size` | `"sm"` \| `"default"` \| `"lg"` \| `"full"` | `"default"` |
| `ref` | `Ref` | — |
| `title` | `string` | `'Notifications'` |
| `headerAction` | `ReactNode` | — |
| `tabs` | `unknown` | — |
| `label` | `string` | — |
| `count` | `number` | — |
| `active` | `boolean` | — |
| `onClick` | `() => void` | — |
| `notifications` | `Array` | — |
| `footer` | `ReactNode` | — |
| `onNotificationAction` | `(notificationId: string, action: string) => void` | — |
| `className` | `string` | — |