3.0.0 • Published 2 years ago

icomoon-react v3.0.0

Weekly downloads
4,516
License
ISC
Repository
github
Last release
2 years ago

Build Status Coverage Status

icomoon-react

Hero Image

React Component which let you use icomoon selection.json file to render SVG instead font

Short example can be found here

installation with YARN:

yarn add icomoon-react

installation with NPM:

npm install icomoon-react

Quick usage:

use selection.json generated from http://icomoon.io/app

  • add your desired icons, select from ready library or add custom svg's
  • once done click Generate Font
  • click Download
  • unzip package and grab your selection.json
import iconSet from "somewhere/selection.json";
import IcomoonReact, { iconList } from "icomoon-react";

than just use component in code:

<IcomoonReact iconSet={iconSet} color="#444" size={100} icon="shower" />

To console.log all icons use: iconList(iconSet) function

Advanced usage:

To not include set all over again just create your wraper component:

Icon.tsx

import React from "react";

import IcomoonReact from "../IcomoonReact";
import iconSet from "./pathToSelection/selection.json";

const Icon: React.FC<{
  color?: string,
  size: string | number,
  icon: string,
  className?: string
}> = props => {
  const { color, size = "100%", icon, className = "" } = props;
  return (
    <IcomoonReact
      className={className}
      iconSet={iconSet}
      color={color}
      size={size}
      icon={icon}
    />
  );
};

export default Icon;

App.tsx

import React from "react";
import Icon from "./Icon";

const App = () => (
  <div>
    <Icon color="#444" size={100} icon="star" />
  </div>
);

export default App;

Develop

clone repo git clone git@github.com:ponciusz/icomoon-react.git

yarn install

yarn start

2.1.0

2 years ago

3.0.0

2 years ago

2.0.19

4 years ago

2.0.20

4 years ago

2.0.18

4 years ago

2.0.15

4 years ago

2.0.16

4 years ago

2.0.14

4 years ago

2.0.12

4 years ago

2.0.11

4 years ago

2.0.8

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

1.0.1

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.5

4 years ago

1.0.0

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago