Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

custom-notification-bell

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

custom-notification-bell

A customizable notification bell component

latest
npmnpm
Version
1.0.53
Version published
Weekly downloads
77
2.67%
Maintainers
1
Weekly downloads
 
Created
Source

🔔 NotificationBell

npm version npm downloads license

A reusable React notification bell component for real-time notifications via WebSocket and REST API.
Designed to be framework-agnostic: no hardcoded navigation — you decide what happens when users click notifications.

🚀 Features

  • 📡 Real-time updates via WebSocket
  • 📥 Fetch past notifications via REST API
  • 🎨 Customizable icon & theme
  • Lightweight, no extra dependencies
  • 🛠️ Pluggable navigation (onNotificationClick, onSeeAllClick)

📦 Installation

npm install custom-notification-bell
# or
yarn add custom-notification-bell

##  Usage

import { NotificationBell } from "custom-notification-bell";
import { BiBell } from "react-icons/bi";
import { useNavigate } from "react-router-dom";

export default function App() {
  const navigate = useNavigate();

  return (
    <NotificationBell
      websocketUrl="https://your-websocket-endpoint"
      apiUrl="https://your-api/notification"
      bellIcon={<BiBell size={15} />}
      userId="user-123"
      theme="dark"
      showConnectionStatus={true}
      onNotificationClick={(notification) => {
        // 🔹 Host app controls navigation
        if (notification.type === "comment") {
          navigate(`/reviews/${notification.relatedEntity?.id}`);
        } else {
          navigate("/notifications");
        }
      }}
      onSeeAllClick={() => {
        navigate("/notifications");
      }}
    />
  );
}

Keywords

react

FAQs

Package last updated on 25 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts