GitHub
Core
Glass
Brutal
Humanist

Notification

A brief alert element used to inform users about important updates, messages, or actions.

Notification Dropdown Playground

Notification Dropdown Playground
Preview
Code

New comment on your design

Sarah mentioned you in "Dashboard Redesign"

2 min ago

Task assigned to you

Complete the wireframes for mobile app

15 min ago

Deadline approaching

Project milestone due in 2 days

1 hour ago

Task overdue

UI review was due yesterday

3 hours ago

Design approved

Your homepage design has been approved

5 hours ago

Meeting scheduled

Team sync tomorrow at 10:00 AM

8 hours ago

Payment received

Invoice #1234 has been paid

1 day ago

Security alert

New login detected from unknown device

2 days ago

Controls
Size:
Default
Large

Notification Item Playground

Notification Item Playground
Preview
Code

New comment on your design

Sarah mentioned you in "Dashboard Redesign"

2 min ago

Controls
Size:
Default
Large
Leading:
Icon
Avatar
Brand
None
State:
Default
Warning
Success
Error
Unread:
Description:
Timestamp:

Installation

You can add the notification component to your project manually:

1

Install the following dependencies:

npm install class-variance-authority clsx tailwind-merge @phosphor-icons/react
2

Copy and paste the following code into your project.

Loading source code...
3

Update the import paths to match your project setup.

Update the import aliases (e.g. @/components, @/utils) in the copied files to match your project's path configuration.

Basic Usage

Notification Dropdown

Use NotificationDropdown to display a floating list of notifications with "Mark all as Read" and "View All" actions:

import { NotificationDropdown } from '@versaui/ui/components/Notification';

const notifications = [
  {
    id: '1',
    title: 'Meeting rescheduled',
    description: 'Design sync has been moved to 3:30 PM.',
    timestamp: '10m ago',
    unread: true,
    leadingItem: 'icon',
    iconState: 'warning',
  },
  {
    id: '2',
    title: 'Sarah commented on your design',
    description: '"The new glassmorphism modal looks clean!"',
    timestamp: '1h ago',
    unread: true,
    leadingItem: 'avatar',
  },
];

export function Example() {
  return (
    <NotificationDropdown
      size="default"
      notifications={notifications}
      onNotificationClick={(id) => console.log('Clicked notification:', id)}
      onMarkAllAsRead={() => console.log('Mark all read')}
      onViewAll={() => console.log('View all notifications')}
    />
  );
}

Notification Item

NotificationItem can also be rendered independently in activity feeds, drawer panels, or custom menus:

import { NotificationItem } from '@versaui/ui/components/Notification';
import { CalendarBlank } from '@phosphor-icons/react';

export function Example() {
  return (
    <NotificationItem
      size="default"
      leadingItem="icon"
      icon={<CalendarBlank weight="duotone" />}
      iconState="warning"
      title="Sprint Review scheduled"
      description="Join the team sprint review meeting at 4:00 PM."
      timestamp="15m ago"
      unread
      onClick={() => console.log('Notification clicked')}
    />
  );
}

Notification Icon Trigger

NotificationIcon provides a bell button trigger with an optional unread dot:

import { useState } from 'react';
import { NotificationIcon, NotificationDropdown } from '@versaui/ui/components/Notification';

export function HeaderNotification() {
  const [isOpen, setIsOpen] = useState(false);
  const [hasUnread, setHasUnread] = useState(true);

  return (
    <div className="relative">
      <NotificationIcon
        selected={isOpen}
        notificationDot={hasUnread}
        onClick={() => setIsOpen(!isOpen)}
      />
      {isOpen && (
        <div className="absolute right-0 top-10 z-50">
          <NotificationDropdown
            notifications={[/* ... */]}
            onMarkAllAsRead={() => setHasUnread(false)}
          />
        </div>
      )}
    </div>
  );
}

Component Props

NotificationDropdown Props

PropTypeDefaultDescription
size'default' | 'large''default'Size variant of the dropdown and its child items.
notificationsNotificationData[]—Array of notification data objects to render in the list.
onNotificationClick(id: string) => void—Callback invoked when a notification row is clicked.
onMarkAllAsRead() => void—Callback invoked when the "Mark all as Read" button is clicked.
onViewAll() => void—Callback invoked when the "View All" link button is clicked.
maxHeightnumber400Maximum height of the scrollable notification list in pixels.
classNamestring''Optional CSS class name for custom styling.

NotificationItem Props

PropTypeDefaultDescription
titlestring—Primary title text (required).
size'default' | 'large''default'Size variant adjusting padding, font sizes, and icon sizing.
leadingItem'none' | 'icon' | 'avatar' | 'brand''none'Type of visual element displayed on the leading side.
descriptionstring—Secondary descriptive text below the title.
timestampstring—Timestamp string (e.g. "5m ago", "Yesterday").
unreadbooleanfalseWhether the item has an unread red indicator dot.
iconReactNode—Custom icon element when leadingItem="icon".
iconState'default' | 'warning' | 'error' | 'success''warning'Visual state container color for the leading icon.
avatarReactNode—Avatar element when leadingItem="avatar".
brandReactNode—Brand icon element when leadingItem="brand".
onClick() => void—Click handler called when the notification item is clicked.
classNamestring''Optional CSS class name.

NotificationIcon Props

PropTypeDefaultDescription
selectedbooleanfalseControls whether the trigger button displays the active/selected border state.
notificationDotbooleanfalseWhether to show the red notification status badge dot.
onClick() => void—Click handler when the icon button is clicked.
classNamestring''Optional CSS class name.

On this page