NotificationList
A list of notifications: the newest first, unread ones with the light, each with what happened and when.
import { NotificationList, NotificationListSkeleton } from '@sypnia/ui/react'
On a page, beside its skeleton
1 unread
Code
import { useState } from 'react';
import { NotificationList, NotificationListSkeleton, Panel, type NotificationEntry } from '@sypnia/ui/react';
// The same list on a page, beside its skeleton. Fixed dates, so the page reads the same on the server and in the browser.
const start: NotificationEntry[] = [
{ id: '1', title: 'Usage at 80% of the plan', body: 'Storage will be full in about 9 days at this pace.', at: '2026-11-16T09:30:00Z', unread: true, icon: 'usage', tone: 'warn' },
{ id: '2', title: 'New sign-in from Bogotá', at: '2026-11-12T18:05:00Z', icon: 'shield' },
];
export default function Page() {
const [items, setItems] = useState(start);
return (
<div className="sy-grid">
<Panel flush><NotificationList items={items} onOpen={() => {}} onReadAll={() => setItems(items.map((i) => ({ ...i, unread: false })))} /></Panel>
<Panel flush><NotificationListSkeleton items={2} /></Panel>
</div>
);
} When to use it
Use it when
- Inside the bell, or on a page of its own.
- Say what happened and, in the body, what to do about it.
Do not use it when
- Long messages: link to the page that explains.
For everyone
- Unread ones say «Unread» to screen readers, not only with the light.
- Each one is a link or a button with its title as name.
Props
| NotificationList | Type | Default |
|---|---|---|
itemsrequired | NotificationEntry[] | |
emptyShown when there is nothing. Defaults to «Nothing new». | ReactNode | |
loadingThe notifications are on their way: pass the last known ones (or typical ones) as `items`; each is drawn in its place, its icon, title, text and time as skeletons as long as theirs. | boolean | |
onOpen | ((id: string) => void) | |
onReadAll | (() => void) |
| NotificationListSkeleton | Type | Default |
|---|---|---|
items | number | 3 |