ValyroUI English version

Notification Center

Центр уведомлений. Бесплатно, MIT · Окна и уведомления › Сообщения и статус

Установка

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';

Пропсы

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.

Похожие компоненты

  • Alert — Предупреждения
  • Toast — Всплывающие уведомления
  • Loading Overlay — Экран загрузки
  • Dialog — Модальные окна
  • Confirm Dialog — Подтверждение действий
  • Drawer — Выдвижные панели
  • Bottom Sheet — Нижняя шторка в стиле iOS: точки остановки, свайп, режим «подглядывания»
  • Popover — Всплывающий контент
  • Hover Card — Карточка при наведении
  • Tour — Онбординг-тур: подсветка элементов, шаги, прогресс и возобновление

Назад: Toast · Далее: Loading Overlay · Весь раздел «Окна и уведомления»