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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@printy/react-context-menu

v2.0.0

Published

Context menu component for React

Downloads

16

Readme

React context menu

react-context-menu-example

This is a small React package that helps you with setting up context menus (the ones that appear when you right click).

Note: This library is in early development and may not work properly in all environments.

Documentation

Features

  • Multiple contexts
  • Nested contexts
  • Menu doesn't overflow page at borders
  • Fully customizable

Setup

To install this package, simply run npm i @printy/react-context-menu

Usage

To create a context menu area (area in which the context menu will be allowed to activate), import and create a <ContextMenuContainer /> component. If you want to apply the context to an already existing element, simply add <ContextMenuContainer /> inside it and it will automatically stretch to the size of its container

You must pass a single prop menu which specifies the component to render as the context menu.

This package focuses on helping with the functionality and behavior of a context menu, not appearance. As such, you will have to create the menu component yourself. But I have added a basic <Menu/> component that you can use as a baseline.

The <Menu/> component accepts a single prop options, which is an array of objects with properties label and onClick. label is the label that will appear on the menu item, and onClick is the event handler for clicking on the item.

You can create multiple <ContextMenuContainer/>s each with their own menu component, and you can also nest multiple <ContextMenuContainer/>s

Contributing

If you want to contribute, you can submit bug reports or add new features and submit a PR. Before starting work on a new branch, please share your idea in the repo's issues section and have it approved (it will most likely get approved even if it's a crazy idea)

Support

For any questions or issues feel free to submit an issue on the repo