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

@dudiharush/react-custom-icon

v1.0.55

Published

React Custom Icon uses SVG for the icon content

Downloads

21

Readme

react-custom-icon

React Custom Icon uses SVG for the icon content, and the icon types are type safe, with intellisense (via Typescript)

installation

run: npm i @dudiharush/react-custom-icon

usage example

import * as React from "react";
import { IconMap, getCustomIcon } from "@dudiharush/react-custom-icon";

// step 1: define an icon map object
const iconMap: IconMap = {
  IconName1: {
    content: (
      <path
        fillRule="evenodd"
        d="M16 7H2V3h4.046l1.059 2H16v2zM2 15h14V9H2v6zM8 3L7 1H1.065C.474 1 0 1.475 0 2.024V16c0 .615.41 1 1.065 1H17c.496 0 1-.512 1-1V4c0-.533-.452-1-1-1H8z"
      />
    ),
    viewBoxSize: 18
  },
  IconName2: {
    content: (
      <path
        fillRule="evenodd"
        d="M16 7H2V3h4.046l1.059 2H16v2zM2 15h14V9H2v6zM8 3L7 1H1.065C.474 1 0 1.475 0 2.024V16c0 .615.41 1 1.065 1H17c.496 0 1-.512 1-1V4c0-.533-.452-1-1-1H8z"
      />
    ),
    viewBoxSize: 18
  },
  IconName3: {
    content: (
      <path d="M9 1c1.657 0 3 1.343 3 3 0 .757-.28 1.448-.743 1.976l3.063 5.101c.219-.05.446-.077.68-.077 1.657 0 3 1.343 3 3s-1.343 3-3 3c-1.306 0-2.417-.834-2.829-2H5.829C5.417 16.167 4.306 17 3 17c-1.657 0-3-1.343-3-3s1.343-3 3-3c.241 0 .476.029.701.082l3.012-5.14C6.268 5.417 6 4.74 6 4c0-1.657 1.343-3 3-3zM3 13c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1zm12 0c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1zM8.442 6.948l-3.061 5.226c.19.248.342.526.448.826h6.342c.108-.307.266-.592.462-.844l-3.12-5.2C9.348 6.985 9.176 7 9 7c-.19 0-.377-.018-.558-.052zM9 3c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1z" />
    ),
    viewBoxSize: 18
  }
};

export function App() {

  // step 2: get <CustomIcon> component by passing the icon map from step 1
  const CustomIcon = getCustomIcon(iconMap);
  return (
    <div>
       <CustomIcon size={18} color="blue" stroke="black" type="IconName1" />
    </div>
  );
}