Skip to Content
BlocksNotificationsBlock

NotificationsBlock

A notification panel with support for read/unread states, avatars, and timestamps.

Import

import { NotificationsBlock } from "@raydenui/ui/blocks";

Usage

Notifications

3 unread
David left a comment on Site redesign
Unread
Mar 21, 2024
10 mins
Sarah shared a file with you
Unread
Mar 20, 2024
2 hours
Mike mentioned you in Project Alpha
Mar 19, 2024
1 day
<NotificationsBlock unreadCount={7} items={[ { id: "1", avatar: <Avatar type="image" src="..." size="sm" />, text: ( <> <span className="font-medium">David</span> left a comment on{" "} <span className="font-medium text-primary-400">Site redesign</span> </> ), date: "Mar 21, 2024", time: "10 mins", unread: true, }, { id: "2", avatar: <Avatar type="image" src="..." size="sm" />, text: ( <> <span className="font-medium">Sarah</span> shared a file with you </> ), date: "Mar 20, 2024", time: "2 hours", unread: false, }, ]} />

With File Attachment

<NotificationsBlock items={[ { id: "1", avatar: <Avatar type="image" src="..." size="sm" />, text: "David shared a file", date: "Mar 21, 2024", time: "10 mins", unread: true, content: { type: "file", title: "Meeting minutes", size: "13MB", fileType: "PDF File", date: "11 Sept 23", }, }, ]} />

With Action Buttons

<NotificationsBlock items={[ { id: "1", avatar: <Avatar type="image" src="..." size="sm" />, text: "You have a pending invitation", date: "Mar 21, 2024", time: "10 mins", content: { type: "cta", primaryAction: { label: "Accept" }, secondaryAction: { label: "Decline" }, }, }, ]} />

Props

NotificationsBlockProps

PropTypeDefaultDescription
titlestring"Notifications"Header title
unreadCountnumber—Number of unread notifications
itemsNotificationItem[]—Array of notifications (required)
onItemClick(id: string) => void—Click handler
onMarkAllRead() => void—Mark all as read handler
classNamestring—Additional CSS classes

NotificationItem

PropTypeRequiredDescription
idstringYesUnique identifier
avatarReactNodeYesAvatar element
textReactNodeYesNotification message
datestringYesDate string
timestringYesRelative time (e.g., “10 mins”)
unreadbooleanNoUnread state indicator
link{ label, href }NoOptional link
contentFileContent | CTAContent | CommentContentNoAdditional content

Accessibility

  • Notification items are keyboard navigable
  • Unread indicators are announced to screen readers
  • Action buttons have proper focus states
Last updated on