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

react-right-click-context-menu

v1.0.1

Published

custom context menu on right click

Downloads

13

Readme

React-right-click-menu

A custom context menu with a default styles but u can modify it and set ur style

Installation

npm i react-right-click-context-menu

also You can clone it

  git clone https://github.com/amirho1/react-right-click-context-menu

then

Installing Dependencies

  npm i

test

  npm run test

Demo

  npm run serve

Build

after getting build you need to copy the scss files in to their files in dist for example MapLI.scss and RightClickMenu.scss

npm run build

Example

<RightClickMenu
  menuClassName="menu-demo"
  liClassName="something"
  rightClickTargets={[
    {
      className: "demo-right",
      menuList: [
        <a
          href="https://github.com/amirho1/react-right-click-menu.git"
          target="_blank">
          <i className="fab fa-github"></i> github
        </a>,
        <a target="_blank">
          <i className="fas fa-paste"></i> Copy
        </a>,
        <a>
          <input type="checkbox" id="checkbox" />
          <label htmlFor="checkbox">checkbox</label>
        </a>,
      ],
    },
    {
      className: "demo-left",
      menuList: [
        <a
          href="https://www.linkedin.com/in/amirhossien-salighedar-8b165618a/"
          target="_blank">
          <i className="fab fa-linkedin"></i> linkedin
        </a>,
        <a href="#" target="_blank">
          <i className="fas fa-paste"></i> Paste
        </a>,
        <span>
          {" "}
          <i className="fas fa-trash"></i> delete
        </span>,
      ],
    },
  ]}
/>

Demo Example

export default function Demo() {
  return (
    <div className="demo">
      <RightClickMenu
        menuClassName="menu-demo"
        rightClickTargets={[
          {
            className: "demo-right",
            menuList: [
              <a
                href="https://github.com/amirho1/react-right-click-menu.git"
                target="_blank">
                <i className="fab fa-github"></i> github
              </a>,
              <a target="_blank">
                <i className="fas fa-paste"></i> Copy
              </a>,
              <a>
                <input type="checkbox" id="checkbox" />
                <label htmlFor="checkbox">checkbox</label>
              </a>,
            ],
          },
          {
            className: "demo-left",
            menuList: [
              <a
                href="https://www.linkedin.com/in/amirhossien-salighedar-8b165618a/"
                target="_blank">
                <i className="fab fa-linkedin"></i> linkedin
              </a>,
              <a href="#" target="_blank">
                <i className="fas fa-paste"></i> Paste
              </a>,
              <span>
                {" "}
                <i className="fas fa-trash"></i> delete
              </span>,
            ],
          },
        ]}
      />

      <div className="demo-left">
        <div className="description">
          <h1>React-right-click-menu</h1>
          <p className="text">
            React right click menu is a library to help developer focus on the
            main concept it supports{" "}
            <a href="https://www.typescriptlang.org/">Typescript</a> also
            <a href="">Javascript</a>
            click on sides to see the default style and behavior of menu for
            further reading go to repository
          </p>

          <h2>
            <a href="https://github.com/amirho1/react-right-click-menu">
              Repository
            </a>
          </h2>

          <h2>
            Author :{" "}
            <a href="https://www.linkedin.com/in/amirhossien-salighedar-8b165618a/">
              {" "}
              AmirHossein Salighedar
            </a>
          </h2>
        </div>
      </div>
      <div className="demo-right"></div>
    </div>
  );
}

Properties

| Name | Type | Description | | ---------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | rightClickTargets | {className: string, menuList: element or string}[] | targets that we want to have contextMenu it's required and className is name of targets that library should follow them, menuList is context menu list Items | | menuClassName | string | className of UL the (wrapper) | | liClassName | string | className of each LI inside UL | | preventDefaultOnWindow | boolean | by default true preventsFrom right click on window |

License

MIT

Author

Xerxes (AmirHossein Salighedar)