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

@p.network/react-web3-settings

v1.2.0

Published

react-web3-settings is a handy React component that provides an easy-to-use interface for managing your Web3 settings such as Node RPC, Etherscan API key, Alchemy API key, and more. It was developed to streamline the setup process for developers working w

Downloads

13

Readme

react-web3-settings

react-web3-settings is a handy React component that provides an easy-to-use interface for managing your Web3 settings such as Node RPC, Etherscan API key, Alchemy API key, and more. It was developed to streamline the setup process for developers working with blockchain integrations in React applications.

Features

  • Easy setup for Node RPC
  • Add or update Etherscan API key
  • Add or update Alchemy API key
  • Additional custom configuration settings can be added as needed
  • Settings may be grouped in sections and subsections
  • Sleek and minimal UI

Installation

Install the package in your React project using npm:

npm install react-web3-settings

Or if you prefer using yarn:

yarn add react-web3-settings

Usage

import { Web3SettingsProvider, Web3SettingsButton, useWeb3Settings, getWeb3Settings } from 'react-web3-settings';

<Web3SettingsProvider
  settings={{
    // a normal setting
    alchemyApiKey: {
      label: "Alchemy API Key",
      value: "api key here",
    },
    etherscanApiKey: {
      label: "Etherscan API Key",
      value: "api key here",
    },
    bnbChainRpc: {
      label: "BNB Chain RPC",
      value: "rpc here",
    },
    // this is a section
    polygonSection: {
      label: "Polygon Settings",
      settings: {
        // settings within the section (put them in the settings array)
        rpc: {
          label: "RPC Endpoint",
          value: "rpc here",
        },
        key: {
          label: "Key",
          value: "key here",
        },
      },
    },
  }}
>
  <App />
</Web3SettingsProvider>;
...


const settings = useWeb3Settings()
or
const settings = getWeb3Settings()

const polygonKey = settings.polygonSection.key // access a setting in a section
const bnbRpc = settings.bnbChainRpc

Props

The following props can be used to customize the Web3SettingsProvider component:

  • settings (Settings): An object with initial configuration.
  • drawerDirection ('right' | 'left' | 'top' | 'bottom'): Direction from which the settings drawer will open.
  • drawerStyle (object): Style object for the drawer.
  • title (string): Title text for the settings drawer.
  • titleStyle (object): Style object for the title text.
  • headerStyle (object): Style object for the drawer header.
  • bodyStyle (object): Style object for the drawer body.
  • buttonSaveText (string): Text for the save button.
  • buttonSaveStyle (object): Style object for the save button.
  • buttonResetText (string): Text for the reset button.
  • buttonResetStyle (object): Style object for the reset button.
  • settingRowStyle (object): Style object for the setting rows.
  • labelStyle (object): Style object for the setting labels.
  • inputStyle (object): Style object for the setting input fields.

Contributing

We welcome contributions to improve this library. Please see our contributing guidelines before starting.

License

react-web3-settings is MIT Licensed.