Skip to content
Twentyfirst UIHalo

Notification Center

Navigation · NotificationCenter, NotificationList, DaySeparator

View as Markdown

The bell for the top bar: an unread count on it, and behind it the NotificationList in a popover (a bottom sheet on phones). Items with a date are grouped by day ("Today", "Yesterday", the date in the provider's locale), unread ones are marked, each can link to what it is about (href, rendered through linkAs or UIProvider linkAs), and "Mark all read" calls onReadAll.

  • items, onOpen, onReadAll: the list; opening an item closes the panel.
  • unread overrides the count on the bell (default: the unread items); above 99 it shows "99+".
  • open / onOpenChange make it controlled; sheet={false} keeps the popover on phones.
  • hideFilter drops the "All / Unread" tabs.
  • In AppShell, notifications={{ items, onReadAll }} puts it at the end of the top bar.
  • The bell's accessible name says how many are unread (notificationsUnread in UIProvider messages).

Props

NotificationCenter

PropTypeNotes
unread?numberUnread count on the bell (default: the unread items).
open?booleanWhether the list is open (controlled).
defaultOpen?boolean
onOpenChange?(open: boolean) => void
align?"start" | "end"Which edge of the bell the panel lines up with (default `end`).
side?"top" | "bottom"Opens below the bell (default) or above it.
sheet?booleanOn phones the list opens as a bottom sheet (default true).
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

NotificationList

PropTypeNotes
itemsNotificationItem[]Required
onOpen?(n: NotificationItem) => void
onReadAll?() => void
linkAs?ElementTypeThe element items with an `href` render as (default `UIProvider linkAs`, else `a`).
now?Date | string | numberWhat counts as today for the day groups (default now).
hideFilter?booleanHide the "All / Unread" tabs.
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

DaySeparator

PropTypeNotes
date?Date | string | numberThe day: shows "Today", "Yesterday" or the weekday and date in the provider's locale.
label?stringText instead of the date (e.g. "New messages").
tone?"neutral" | "accent""accent" for the "new messages" line (the signal colour).
now?Date | string | numberWhat counts as today (default now), for stable tests and server rendering.
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.