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

monero-network-selector

v2.0.2

Published

A basic react component that allows users of a monero web application to select from among the three Monero networks (mainnet, stagenet, and testnet).

Readme

MoneroNetworkSelector

A React UI drop-down menu that allows end users of react-based Monero web applications to select which Monero network to use the application with.

Usage

These instructions only apply to independent use of the MoneroNetworkSelector UI component. If you want to use the MoneroNetworkSelector in conjunction with the ConnectionManager UI, use the NetworkConnectionCoordinator component (only available for monero-javascript applications)

Props

The MoneroNetworkSelector component takes three props: setNetworkType, networkTypes, and className.
setNetworkType(optional): A function to handle the user changing the current network. networkTypes(optional): An array of integer values between 0 and 2. Each integer corresponds to a network type:

0: mainnet
1: stagenet
2: testnet

The array specifies which networks the user should be able to choose from. A valid networkTypes array must contain exactly two or three integer elements between 0 and 2. The order of the values in the array determines the order in which they appear in the rendered network selector component. Some examples of valid networkTypes arrays:

  • [0, 2]
  • [0, 1, 2]
  • [2, 1]

Some examples of invalid networkTypes arrays:

  • [0, 0, 1] (repeat values are not allowed)
  • [8, 2] (only the values 0, 1, and 2 are valid)
  • [0] (the array must have at least two elements)
  • [0, 2, 1, 4] (the array must have no more than three elements)

The network selector will default to listing all three networks in the order 0(mainnet), 1(stagenet), 2(testnet) if it does not receive the networkTypes prop.

notes on styling the network selector: The entire network selector element has the class name "network_selector_container". The network selector component contains a "label" element and a "select" element. All three elements can be styled as follows:

.network_selector_container {
  [your styles here]
}

.network_selector_container > label {
  [your styles here]
}

.network_selector_container > select {
  appearance: none;
  --webkit-appearance: none;
  --moz-appearance: none;
  [your styles here]
}

Instructions

  1. Install the MoneroNetworkSelector module from npm:

npm install monero-network-selector

  2. Import the MoneroNetworkSelector component into the javascript file that you intend to use the MoneroNetworkSelector UI in:

import {MoneroNetworkSelector} from "monero-network-selector"

Note that this is a named import and must therefore be surrounded in curly braces "{}" as in the example.

  3. Pass the required props to the MoneroNetworkSelector component in your JSX implementation:

return(
// Your JSX here
<MoneroNetworkSelector 
  setNetworkType = {setNetworkType}
  networkTypeFlags = {[0,1]}
/>
// Your JSX here
)

  4. Implement the setNetworkType function in your javascript file. The function must accept a number value of 0, 1, or 2 as an argument. For example:

const setNetworkType = function(networkType) {
  switch(networkType){
    case 0:
      console.log("Using Mainnet");
      break;
    case 1:
      console.log("Using Stagenet");
      break;
    case 2:
      console.log("Using Testnet");
      break;
  }
}