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

radial-context-menu

v1.0.0

Published

Radial context menu.

Readme

Radial Context Menu

A premium, glassmorphism-style radial context menu for the web. Built with vanilla JavaScript and CSS, featuring smooth animations, nested sub-menus, and support for both Emojis and SVG icons.

Demo Mockup

Features

  • 🚀 Vanilla JS: Zero dependencies.
  • 💎 Glassmorphism: Modern, frosted-glass aesthetic.
  • 📁 Nested Menus: Support for infinite nesting depths.
  • 🖼️ Icon Support: Use any Emoji or SVG file.
  • 🎯 Context Aware: Restrict the menu to specific DOM elements via selectors.
  • ⚡ Performant: Uses event delegation for efficient event handling.

🚀 Initialization

To use the menu, instantiate the RadialContextMenu class, set your configuration properties, and call .init().

import { RadialContextMenu } from "./src/radial-context-menu/radial-context-menu.js";

const menu = new RadialContextMenu();

// 1. Set the data source
menu.itemsSource = [
  { name: "Home", image: "🏠" },
  {
    name: "Settings",
    image: "⚙️",
    children: [
      { name: "Profile", image: "👤" },
      { name: "Security", image: "🔒" },
    ],
  },
];

// 2. Set the trigger selector (Optional - if null, triggers everywhere)
menu.selector = ".context-area";

// 3. Initialize
menu.init();

📡 Events

The menu provides several lifecycle and interaction hooks.

| Event | Callback Signature | Description | | -------------- | ------------------ | -------------------------------------------------------- | | onInit | (menu) => void | Fires after the menu is created and events are attached. | | onOpen | (menu) => void | Fires when the menu is displayed. | | onClose | (menu) => void | Fires after the menu closure animation finishes. | | onHover | (item) => void | Fires when a menu segment is hovered. | | onSelectItem | (item) => void | Fires when a leaf item (no children) is clicked. |

Example:

menu.onSelectItem = (item) => {
  console.log(`User clicked on: ${item.name}`);
};

menu.onOpen = () => {
  // Close other UI elements or pause activities
  console.log("Menu is now visible");
};

🎨 Icon Features

The widget supports two types of icons out of the box.

1. Emoji Icons

Simply pass a Unicode emoji string to the image property. This is the easiest way to get started without extra assets.

{ name: 'Delete', image: '🗑️' }

2. SVG Icons

Pass a path to an SVG file. The component will automatically detect the .svg extension and render it as an image.

{ name: 'Edit', image: 'src/assets/edit.svg' }

Styling SVGs: The menu includes a default CSS filter (brightness/invert) to ensure SVG icons appear white against the dark glass background. You can customize this in radial-context-menu.css.


🛠️ Data Structure

Each item in the itemsSource array follows this structure:

interface MenuItem {
  name: string; // Displayed in the center button on hover
  image: string; // Emoji string or path to .svg file
  children?: []; // Optional nested items
}