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

@notiflows/react

v0.2.0

Published

Notiflows React SDK - components and hooks for notification UIs

Readme

@notiflows/react

Official React SDK for Notiflows - components and hooks for building notification UIs.

Installation

npm install @notiflows/react
# or
pnpm add @notiflows/react
# or
yarn add @notiflows/react

Quick Start

Import the styles and wrap your app with NotiflowsProvider:

import '@notiflows/react/styles.css'
import { NotiflowsProvider } from '@notiflows/react'

function App() {
  return (
    <NotiflowsProvider
      apiKey="pk_your_public_key"
      userId="user_123"
      userKey="jwt_token_here"
      channelId="in_app"
    >
      <YourApp />
    </NotiflowsProvider>
  )
}

Pre-built Components

Use the pre-built notification feed:

import {
  FeedRoot,
  FeedTrigger,
  FeedContent,
  BellButton,
} from '@notiflows/react'

function NotificationBell() {
  return (
    <FeedRoot>
      <FeedTrigger>
        <BellButton />
      </FeedTrigger>
      <FeedContent />
    </FeedRoot>
  )
}

Custom UI with Hooks

Build your own UI using hooks:

import { useFeed, useNotificationStatus } from '@notiflows/react'

function CustomNotifications() {
  const { entries, isLoading, totalUnread, loadMore } = useFeed()
  const { markAsRead, markAllAsRead } = useNotificationStatus()

  if (isLoading) return <div>Loading...</div>

  return (
    <div>
      <p>Unread: {totalUnread}</p>
      <button onClick={markAllAsRead}>Mark all read</button>

      {entries.map((entry) => (
        <div key={entry.id} onClick={() => markAsRead(entry.id)}>
          {entry.data.body}
        </div>
      ))}

      <button onClick={loadMore}>Load more</button>
    </div>
  )
}

Components

Provider

  • NotiflowsProvider - Context provider for Notiflows client

Feed Components

  • FeedRoot - Popover root (wraps Radix Popover)
  • FeedTrigger - Trigger button wrapper
  • FeedContent - Popover content with notification list
  • BellButton - Bell icon with unread badge
  • Badge - Unread count badge
  • Notification - Individual notification item
  • MarkAllAsRead - Button to mark all as read
  • MarkAsArchived - Archive button

Preferences

  • Preferences - Preferences panel with channel toggles

Hooks

useNotiflows()

Access the Notiflows client and feed client:

const { client, feedClient } = useNotiflows()

useFeed(options?)

Manage notification feed state:

const {
  entries,          // FeedEntry[]
  totalUnread,      // number
  totalUnseen,      // number
  isLoading,        // boolean
  isLoadingMore,    // boolean
  error,            // NotiflowsApiError | null
  loadMore,         // () => Promise<void>
  clearError,       // () => void
  retry,            // () => void
} = useFeed({
  status?: 'unseen' | 'unread' | 'read' | 'archived',
  notiflow?: string,    // filter by notiflow handle
  topic?: string,       // filter by topic
  archived?: boolean,   // include archived entries
  limit?: number,
})

useNotificationStatus()

Update notification states:

const {
  markAsSeen,
  markAsRead,
  markAsClicked,
  markAsArchived,
  batchMarkAsRead,
  markAllAsRead,
} = useNotificationStatus()

usePreferences()

Manage user preferences:

const {
  preferences,
  isLoading,
  updateNotiflowPreferences,
} = usePreferences()

Styling

Default Styles

Import the default styles for a ready-to-use UI:

import '@notiflows/react/styles.css'

Customization

Override CSS variables to match your brand:

:root {
  --nf-primary: #your-brand-color;
  --nf-background: #ffffff;
  --nf-foreground: #171717;
  --nf-border: #e5e5e5;
  --nf-radius: 0.5rem;
}

Dark Mode

Add the dark class to a parent element:

<html class="dark">

The components will automatically use dark mode colors.

Next.js

For Next.js App Router, use 'use client' directive:

'use client'

import { NotiflowsProvider } from '@notiflows/react'

Documentation

Full documentation is available at notiflows.com/docs/sdks/client-side/react.

License

MIT