npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@molecule/app-notification-feed-react

v4.1.0

Published

Vertical notification feed: typed icon + title + body + relative time + unread indicator, with optional per-row link wrapping

Readme

@molecule/app-notification-feed-react

Vertical notification feed.

Exports <NotificationFeed> — a list of notification rows with typed icon, title, body, relative time, and unread indicator. Optionally wraps each row in a Link if the notification has an href.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

import { NotificationFeed } from '@molecule/app-notification-feed-react'

const items = [
  { id: '1', icon: 'check_circle', title: 'Build succeeded', body: 'main branch deployed to prod', createdAt: '2024-06-01T09:00:00Z', unread: true, href: '/deployments/42' },
  { id: '2', icon: 'chat', title: 'New comment', body: 'Alice left a comment on PR #17', createdAt: '2024-06-01T08:30:00Z' },
]

<NotificationFeed items={items} ariaLabel="Notifications" dataMolId="notification-feed" />

Type

feature

Installation

npm install @molecule/app-notification-feed-react @molecule/app-react @molecule/app-ui react
npm install -D @types/react

API

Interfaces

FeedItem

A single item rendered inside a NotificationFeed list.

interface FeedItem {
  /** Stable identifier (used as React key). */
  id: string
  /** Material symbol icon name (e.g. `'check_circle'`, `'chat'`). */
  icon: string
  /** Bolded headline string. */
  title: string
  /** Secondary body string. */
  body: string
  /** ISO timestamp shown as relative time on the right. */
  createdAt: string
  /** Optional route — when set, wraps the row in `<Link>`. */
  href?: string | null
  /** When true, the row gets a left primary-accent border. */
  unread?: boolean
}

NotificationFeedProps

Props for the NotificationFeed component.

interface NotificationFeedProps {
  /** Items to render, top to bottom. */
  items: ReadonlyArray<FeedItem>
  /** Aria-label for the underlying `<ul>`. */
  ariaLabel?: string
  /** Extra classes on the outer `<ul>`. */
  className?: string
  /** `data-mol-id` for AI-agent selectors. */
  dataMolId?: string
}

Functions

NotificationFeed(props)

Vertical notification feed: typed icon + title + body + relative time with optional unread border-l accent and optional per-row Link.

Apps build their own typed-icon mapping (notif.type → icon name) and pass the resolved icon string in. Keeps this package free of per-app type unions.

function NotificationFeed({
  items,
  ariaLabel,
  className,
  dataMolId,
}: NotificationFeedProps): JSX.Element
  • props — Component props (see {@link NotificationFeedProps}).

fmtRelativeShort(iso)

Render an ISO timestamp as a short relative string: "12m", "3h", "5d".

Used by NotificationFeed to keep the timestamp tight enough to fit the top-right corner of a feed row.

function fmtRelativeShort(iso: string): string
  • iso — ISO 8601 timestamp string

Returns: short relative string (e.g. "12m", "3h", "5d")

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-react ^4.12.0
  • @molecule/app-ui ^1.3.11
  • react ^18.0.0 || ^19.0.0

Runtime Dependencies

  • @molecule/app-react
  • @molecule/app-ui
  • react

FeedItem.icon is a Material Symbols LIGATURE — the app must load the "Material Symbols Outlined" font and define the material-symbols-outlined CSS class, or icon names render as plain text (the literal string check_circle). The icon circle background and the unread left-border accent additionally rely on raw Tailwind utilities (bg-primary-container, border-l-4) that standard molecule scaffolds neither scan nor theme — add an @source line for this package's dist plus a primary-container theme color, or expect both to be invisible until the package is migrated to ClassMap.

Rows WITH href render a <Link> from @molecule/app-react/link — they THROW outside the app's router (RouterProvider). In apps without a router bond, omit href (rows render as plain divs) or handle navigation on a wrapping element. Requires a wired ClassMap bond — getClassMap() throws before wiring.

fmtRelativeShort (exported) renders compact 12m / 3h / 5d strings with English unit letters — swap in your own formatter for localized feeds by pre-formatting and rendering your own rows.

E2E Tests

Integration checklist — drive the real UI (live preview, no mocks), adapt each item to this app's actual screens/flows, and check every box off one by one. A box you can't check is an integration bug to fix — not a skip:

  • [ ] The feed renders real notifications with icon, title, body, and a relative time — no undefined fields or raw timestamps.
  • [ ] Unread rows are visibly distinct, and any unread badge/count matches the number of unread rows.
  • [ ] Clicking a notification that carries an href navigates to its target.
  • [ ] Marking as read (however this app wires it) clears the unread state and it stays cleared after a full reload.
  • [ ] Performing an action the app notifies about adds a new notification to the feed (newest first).
  • [ ] An empty feed shows a readable empty state — not a blank panel.