Skip to main content
BlocksNotificationsNotification centre panel with tabs

shadcn/ui Notifications block for React AriaNotification centre panel with tabs

Notification centre in a max-w-md shadcn/ui Card: the header carries an unread-count Badge and icon Buttons with Tooltips for "Mark all as read" and settings, Tabs switch between All, Unread and Mentions, and each row combines an Avatar, a sentence with the actor in bold, a relative time and an unread dot. Rows mark themselves read on click and empty tabs show a friendly caught-up state. Drop it into a sidebar, sheet or popover.

Free@shadcnpro/aria/notifications-01

Preview

Installation

npx shadcn@latest add @shadcnpro/aria/notifications-01

First time? Add the @shadcnpro registry to components.json as shown in Installation. Free blocks install without a license key.

Let your AI editor install it

The shadcn/ui Pro MCP server lets Cursor, Claude Code and VS Code find and install blocks like Notification centre panel with tabs from one prompt. It is included in every Pro plan.

Add the shadcn/ui components

Notification centre panel with tabs uses Avatar, Badge, Button, Card, Tabs and Tooltip, from the React Aria components set up in your components.json.

npx shadcn@latest add avatar badge button card tabs tooltip

Install the npm packages

npm install lucide-react

Copy the code

Paste it into components/blocks/notifications-01.tsx.

components/blocks/notifications-01.tsx
'use client';

import { BellOffIcon, CheckCheckIcon, SettingsIcon } from 'lucide-react';
import { useState } from 'react';

import { cn } from '@/lib/utils';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
import {
  Card,
  CardContent,
  CardFooter,
  CardHeader,
  CardTitle,
} from '@/components/ui/card';
import {
  Tabs,
  TabsContent,
  TabsList,
  TabsTrigger,
} from '@/components/ui/tabs';
import { Tooltip, TooltipTrigger } from '@/components/ui/tooltip';

type Notification = {
  id: number;
  actor: string;
  slug: string;
  action: string;
  target: string;
  time: string;
  read: boolean;
  mention?: boolean;
};

const initialNotifications: Notification[] = [
  {
    id: 1,
    actor: 'Priya Raman',
    slug: 'priya-raman',
    action: 'mentioned you in',
    target: 'AUR-142 · Push notification opt-in copy',
    time: '12 min ago',
    read: false,
    mention: true,
  },
  {
    id: 2,
    actor: 'Daniel Achterberg',
    slug: 'daniel-achterberg',
    action: 'assigned you',
    target: 'AUR-157 · Billing v2 proration edge cases',
    time: '48 min ago',
    read: false,
  },
  {
    id: 3,
    actor: 'Oskar Berg',
    slug: 'oskar-berg',
    action: 'commented on',
    target: 'AUR-138 · Onboarding carousel flickers on Android 14',
    time: '2 hours ago',
    read: false,
  },
  {
    id: 4,
    actor: 'Elin Dahl',
    slug: 'elin-dahl',
    action: 'moved to Done',
    target: 'AUR-129 · Empty state for archived projects',
    time: '3 hours ago',
    read: true,
  },
  {
    id: 5,
    actor: 'Beacon Deploys',
    slug: 'beacon-deploys',
    action: 'deployed build #482 to staging for',
    target: 'Billing v2',
    time: '5 hours ago',
    read: true,
  },
  {
    id: 6,
    actor: 'Noah Fischer',
    slug: 'noah-fischer',
    action: 'accepted your invite to',
    target: 'Design System',
    time: 'Yesterday',
    read: true,
  },
  {
    id: 7,
    actor: 'Elin Dahl',
    slug: 'elin-dahl',
    action: 'mentioned you in',
    target: 'Design System · Token naming v3',
    time: 'Yesterday',
    read: true,
    mention: true,
  },
  {
    id: 8,
    actor: 'Beacon',
    slug: 'beacon-reminders',
    action: 'reminder: due tomorrow',
    target: 'AUR-151 · Rename plan tiers in checkout',
    time: 'Yesterday',
    read: false,
  },
];

const initials = (name: string) =>
  name
    .split(' ')
    .map((part) => part[0])
    .join('')
    .slice(0, 2);

/**
 * Notification centre panel in a max-w-md Card: header with unread-count Badge and a "Mark all as read" action, Tabs for All / Unread / Mentions, Avatar rows with bold actors and unread dots, and a "View all" footer link.
 */
export default function Notifications01() {
  const [items, setItems] = useState(initialNotifications);
  const unread = items.filter((item) => !item.read).length;

  const markAllRead = () =>
    setItems((prev) => prev.map((item) => ({ ...item, read: true })));
  const markRead = (id: number) =>
    setItems((prev) =>
      prev.map((item) => (item.id === id ? { ...item, read: true } : item))
    );

  const renderList = (list: Notification[], emptyCopy: string) =>
    list.length === 0 ? (
      <div className="flex flex-col items-center gap-2 px-6 py-12 text-center">
        <span className="flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground">
          <BellOffIcon aria-hidden="true" className="size-5" />
        </span>
        <p className="font-medium text-foreground text-sm">You are all caught up</p>
        <p className="text-muted-foreground text-sm">{emptyCopy}</p>
      </div>
    ) : (
      <ul className="divide-y">
        {list.map((item) => (
          <li key={item.id}>
            <button
              className={cn(
                'flex w-full items-start gap-3 px-6 py-3.5 text-left transition-colors hover:bg-muted/50 focus-visible:bg-muted/50 focus-visible:outline-none',
                !item.read && 'bg-primary/5'
              )}
              onClick={() => markRead(item.id)}
              type="button"
            >
              <Avatar className="mt-0.5 size-9">
                <AvatarImage
                  alt={item.actor}
                  src={`https://avatar.vercel.sh/${item.slug}`}
                />
                <AvatarFallback className="text-xs">
                  {initials(item.actor)}
                </AvatarFallback>
              </Avatar>
              <div className="min-w-0 flex-1 space-y-0.5">
                <p className="text-foreground text-sm leading-snug">
                  <span className="font-semibold">{item.actor}</span>{' '}
                  <span className="text-muted-foreground">{item.action}</span>{' '}
                  <span className="font-medium">{item.target}</span>
                </p>
                <p className="text-muted-foreground text-xs tabular-nums">{item.time}</p>
              </div>
              <span
                aria-label={item.read ? undefined : 'Unread'}
                className={cn(
                  'mt-2 size-2 shrink-0 rounded-full',
                  item.read ? 'bg-transparent' : 'bg-primary'
                )}
              />
            </button>
          </li>
        ))}
      </ul>
    );

  return (
    <div className="w-full max-w-md px-4 py-8">
      <Card className="gap-0 py-0">
        <CardHeader className="flex flex-row items-center gap-3 border-b px-6 py-4">
          <CardTitle className="flex items-center gap-2 text-base">
            Notifications
            {unread > 0 ? (
              <Badge className="tabular-nums" variant="secondary">
                {unread} new
              </Badge>
            ) : null}
          </CardTitle>
          <div className="ml-auto flex items-center gap-1">
            <TooltipTrigger>
              <Button
                aria-label="Mark all as read"
                className="text-muted-foreground"
                isDisabled={unread === 0}
                onPress={markAllRead}
                size="icon-sm"
                type="button"
                variant="ghost"
              >
                <CheckCheckIcon aria-hidden="true" />
              </Button>
              <Tooltip>Mark all as read</Tooltip>
            </TooltipTrigger>
            <TooltipTrigger>
              <Button
                aria-label="Notification settings"
                className="text-muted-foreground"
                size="icon-sm"
                type="button"
                variant="ghost"
              >
                <SettingsIcon aria-hidden="true" />
              </Button>
              <Tooltip>Notification settings</Tooltip>
            </TooltipTrigger>
          </div>
        </CardHeader>

        <Tabs className="gap-0" defaultSelectedKey="all">
          <div className="border-b px-6 py-2">
            <TabsList className="h-8">
              <TabsTrigger className="px-3 text-xs" id="all">
                All
              </TabsTrigger>
              <TabsTrigger className="gap-1.5 px-3 text-xs" id="unread">
                Unread
                {unread > 0 ? (
                  <span className="rounded-full bg-primary px-1.5 font-medium text-[10px] text-primary-foreground tabular-nums">
                    {unread}
                  </span>
                ) : null}
              </TabsTrigger>
              <TabsTrigger className="px-3 text-xs" id="mentions">
                Mentions
              </TabsTrigger>
            </TabsList>
          </div>
          <CardContent className="px-0">
            <TabsContent id="all">
              {renderList(items, 'No notifications yet.')}
            </TabsContent>
            <TabsContent id="unread">
              {renderList(
                items.filter((item) => !item.read),
                'Nothing unread. Enjoy the quiet.'
              )}
            </TabsContent>
            <TabsContent id="mentions">
              {renderList(
                items.filter((item) => item.mention),
                'Nobody has mentioned you recently.'
              )}
            </TabsContent>
          </CardContent>
        </Tabs>

        <CardFooter className="justify-center border-t px-6 py-3">
          <a
            className="font-medium text-primary text-sm underline-offset-4 hover:underline"
            href="#"
          >
            View all notifications
          </a>
        </CardFooter>
      </Card>
    </div>
  );
}

Use it

Import it where you need it and update the import path to match your project.

Usage
import Notifications01 from '@/components/blocks/notifications-01';

export default function Page() {
  return <Notifications01 />;
}

Overview

Notification centre panel with tabs is a free notifications block for shadcn/ui and React Aria. It is built from the Avatar, Badge, Button, Card, Tabs and Tooltip components with lucide-react, and installs as a single file you own and can edit.

It only uses semantic tokens such as bg-background, text-muted-foreground and border-border, so it follows your theme, radius and fonts and switches with dark mode. It is responsive from desktop to mobile; the width controls above the preview show each size. The same layout is in the shadcn/ui Pro Figma kit, so design and code start from one source.

Component library
React Aria (react-aria-components)
Also available for
Radix UI, Base UI
Built with
Avatar, Badge, Button, Card, Tabs and Tooltip
npm packages
lucide-react
Files
components/blocks/notifications-01.tsx
Access
Free, installs without a license key

Frequently asked questions

Pricing, installation and React Aria details for Notification centre panel with tabs.