fma-ds

Notification Center

Notifications in the header and on their own page, driven by props and callbacks (no server state).

originalMITexperimentalChangelogRegistry JSON

Overview

  • `NotificationMenu`: the bell — an icon GlanceTrigger whose GlanceIndicator shows the unread count (also in the button's name). It opens a panel with the recent items, "Mark all as read" (onMarkAllAsRead), loading and empty states and a "View all" link (viewAllHref).
  • `NotificationList`: every notification as cards with a read/unread Badge, for a page paired with Pagination.
  • `NotificationItem`: an unread dot (or an icon), the title — a link when it has href, calling onOpen — the message, the date (formatted in the I18nProvider locale) and icon buttons for onMarkAsRead and onDelete, described by the title.

Urgent notifications are a ConfirmDialog opened with useDialogPromise.

Built-in text is in English; override it with i18n.labels.

Installation

  1. 1

    Register the @fma-ds namespace in components.json (once)

    components.json
    {  "registries": {    "@fma-ds": "https://ds.fmartinsandre.dev.br/r/{name}.json"  }}
  2. 2

    Add the item

    pnpm dlx shadcn@latest add @fma-ds/notification-center

    Files land in components/fma-ds/notification-center/notification-center.tsx; npm and registry dependencies are installed along with them.

Dependencies

npm
cn@^0.5.0lucide-react@^1.61.0react-aria-components@^1.22.1