# icomoon-react

> Component let which let you use icomoon selection.json file to display svg's

Latest version **3.0.0** (published 2022-04-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install icomoon-react
pnpm add icomoon-react
yarn add icomoon-react
bun add icomoon-react
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2022-04-28 |
| First published | 2018-07-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 58 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 33 |
| Author | Kamil Albrycht |
| Maintainers | ponciusz |

## Links

- npm: https://www.npmjs.com/package/icomoon-react
- Repository: https://github.com/ponciusz/icomoon-react
- Homepage: https://github.com/ponciusz/icomoon-react#readme
- Issues: https://github.com/ponciusz/icomoon-react/issues
- npm.io page: https://npm.io/package/icomoon-react

## Dependencies (2)

- [react](https://npm.io/package/react.md) >=16.9.0
- [react-dom](https://npm.io/package/react-dom.md) >=16.9.0

## Recent versions

- 3.0.0 (latest) — 2022-04-28
- 2.0.7 (beta) — 2019-12-13
- 2.1.0 — 2022-04-28
- 2.0.19 — 2020-10-31
- 2.0.20 — 2020-10-31
- 2.0.18 — 2020-10-31
- 2.0.16 — 2020-01-07
- 2.0.15 — 2020-01-07
- 2.0.14 — 2019-12-14
- 2.0.12 — 2019-12-14
- 2.0.11 — 2019-12-14
- 2.0.8 — 2019-12-13
- 2.0.6 — 2019-12-13
- 2.0.5 — 2019-12-07
- 2.0.3 — 2019-12-07
- … 31 more at https://npm.io/package/icomoon-react/versions

## README

[![Build Status](https://travis-ci.org/ponciusz/icomoon-react.svg?branch=master)](https://travis-ci.org/ponciusz/icomoon-react) [![Coverage Status](https://coveralls.io/repos/github/ponciusz/icomoon-react/badge.svg?branch=master)](https://coveralls.io/github/ponciusz/icomoon-react?branch=master)

# icomoon-react

![Hero Image](/images/hero.png)

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

Short example can be found [here](https://codesandbox.io/s/q89onw1kqq)

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`

```js
import iconSet from "somewhere/selection.json";
import IcomoonReact, { iconList } from "icomoon-react";
```

than just use component in code:

```js
<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

```js
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

```js
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`

---
_Source: https://npm.io/package/icomoon-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
