ValyroUI Русская версия

Notification Center

Notification inbox. Free, MIT · Overlays and notifications › Messages and status

Installation

npx valyro-cli@latest add notification-center
npx shadcn@latest add https://valyro.xyz/r/notification-center.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { NotificationCenter } from 'valyro-ui';

Props

PropTypeDefault
notifications *NotificationItem[]Items in display order; unread ones (read not set) drive the bell badge and the Unread filter.
titleReactNode'Notifications'Panel heading; also its accessible name.
onItemClick(item: NotificationItem) => voidTurns items into buttons; mark the item read yourself (e.g. set read and pass the list back).
onMarkAllRead() => voidShows the "Mark all read" button.
footerReactNodeContent under the list, e.g. a "View all" link.
emptyMessageReactNode'You’re all caught up'Shown instead of the list when the current filter has no items.
labelsPartial<NotificationCenterLabels>Overrides for the built-in strings.
localestringBCP 47 locale for the relative times ("5 minutes ago") and counts. Defaults to the ThemeProvider locale, then English — the times are words, so they follow the (English) default labels.
openbooleanControlled open; use with onOpenChange.
defaultOpenbooleanfalseInitial open when uncontrolled.
onOpenChange(open: boolean) => voidCalled with the new open when it changes.
placementPlacement'bottom-end'
offsetnumber
matchAnchorWidthboolean
closeOnOutsideboolean
closeOnEscapeboolean
insideRefsRefObject<Element | null>[]Extra elements treated as "inside" for outside-press detection. The anchor is included automatically.
surfacebooleanApply the shared .ui-floating material (default true).
animation'pop' | 'fade' | 'spring' | 'none'Enter/exit: pop (the theme's), fade, spring (springs out of the anchor's side) or none.

Related components

Previous: Toast · Next: Loading Overlay · All Overlays and notifications