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-icons-selector

v0.2.2

Published

A customizable icon picker component for React with support for multiple icon libraries.

Downloads

7

Readme

React Icons Selector

A simple and customizable icon selector component supporting multiple icon libraries, built with the react-icons library for use in your React applications.

Table of Contents

Features

  • Multiple Icon Library Support: Supports popular libraries like Font Awesome, Material Design Icons, Ionicons, and more.
  • Search Functionality: Allows searching icons by name with a delay setting for performance optimization.
  • Modal Interface: An interactive modal for selecting icons.
  • Customizable Interface: Options to customize button styles and language text.
  • Dynamic Icon Loading: Icons are dynamically loaded based on user input.

Installation

Install the necessary dependencies to add this component to your project:

npm install react-icons-selector --save

Usage

Here’s an example of how to use the React Icons Selector component in your project:

import React, { useState } from 'react';
import ReactIconsSelector from 'react-icons-selector';

const MyComponent = () => {
  const [selectedIcon, setSelectedIcon] = useState(null);

  return (
    <div>
      <ReactIconsSelector
        value={selectedIcon}
        onChange={setSelectedIcon}
      />
    </div>
  );
};

export default MyComponent;

Customization

Here’s an example of using the React Icons Selector component with custom settings:

import React, { useState } from 'react';
import ReactIconsSelector from 'react-icons-selector';
import libraries from "react-icons-selector/lib/libraries";

const MyComponent = () => {
  const [selectedIcon, setSelectedIcon] = useState({
    name: 'MdOutlineSearch',
    library: 'Material Design Icons',
  });

  return (
    <div>
      <ReactIconsSelector
        value={selectedIcon}
        onChange={setSelectedIcon}
        icons={["Font Awesome 5", "Ant Design Icons", "css.gg"]}
        buttonStyle={{ width: 200, fontSize: 40 }}
        buttonClassName="btn"
        language={{
            homeText: "Home",
            headerText: "Pick Your Icon",
            noIconsFoundText: "No icons matched your search.",
            homeSearchText: "Search icons...",
            buttonText: "Choose an Icon",
        }}
      />

      <div style={{ fontSize: 100 }}>
        {React.createElement(
          libraries[selectedIcon.library][selectedIcon.name]
        )}
      </div>
    </div>
  );
};

export default MyComponent;

Supported Icon Libraries

This selector supports the following icon libraries:

  • Font Awesome 5
  • Ant Design Icons
  • BoxIcons
  • Bootstrap Icons
  • css.gg
  • Devicons
  • Feather
  • Game Icons
  • Github Octicons
  • Grommet Icons
  • Heroicons
  • Ionicons 4 & 5
  • Material Design Icons
  • Remix Icons
  • Simple Icons
  • Tabler Icons
  • Typicons
  • Phosphor Icons
  • VS Code Icons
  • Weather Icons
  • Line Awesome
  • IcoMoon Free
  • Lucide
  • Circum Icons

Dependencies

The following libraries are required for this project:

  • react-icons: A library for using popular icons in React applications.

Contributors

License

This project is licensed under the MIT License. For more information, see the LICENSE file.