iconoir/packages/iconoir-react
2021-05-23 00:02:28 +01:00
..
bin Create build script to build React icons 2021-05-18 00:03:45 +01:00
src Update iconoir-react to use iconoir v4.3.0 2021-05-23 00:02:28 +01:00
.gitignore Create build script to build React icons 2021-05-18 00:03:45 +01:00
.npmignore Add npmignore 2021-05-19 20:37:16 +01:00
LICENSE Add License 2021-05-19 19:51:25 +01:00
package-lock.json Update iconoir-react to use iconoir v4.3.0 2021-05-23 00:02:28 +01:00
package.json Update iconoir-react to use iconoir v4.3.0 2021-05-23 00:02:28 +01:00
README.md Update iconoir-react to use iconoir v4.3.0 2021-05-23 00:02:28 +01:00
rollup.config.js Configure rollup bundle 2021-05-19 19:51:24 +01:00

React Iconoir Icons

npm npm

Iconoir is an open source library with 900+ SVG Icons. No premium icons, no email sign-up, no newsletters. You can browse the full suite of icons at iconoir.com.

iconoir-react is an open source package that exports these icons as React.js components that can be used in all of your React projects.

Based on Iconoir Icons v4.3.0.

Installation

yarn add iconoir-react

or

npm i iconoir-react

Usage

import React from 'react';
import { Iconoir } from 'iconoir-react';

const App = () => {
  return <Iconoir />
};

export default App;

Icons can take the optional props color: string and size: string | number, e.g.

<Iconoir color="red" size={36} />

The default color is "currentColor" and the default size is 24.

Icon names

For the most part, the React components are named as PascalCase variations of their reference names (i.e. add-circle-outline becomes AddCircleOutline). However, some names have been altered slightly either because they start with numerical digits, which would lead to invalid React component names, or because they are organisations which use PascalCase in their brand names, such as GitHub. The altered names are as follows:

Iconoir Name React Component
1st-medal Medal1st
4k-display Display4k
4x4-cell Cell4x4
github GitHub
github-outline GitHubOutline
gitlab-full GitLabFull
linkedin LinkedIn
tiktok TikTok
youtube YouTube

TypeScript

The types Icon and IconProps are provided by default within the package. If you are using TypeScript, you can just import them from the iconoir-react package.

import React from 'react';
import { Iconoir, IconProps } from 'iconoir-react';

const App: React.FC<{}> = () => {
  const props: IconProps = {
    color: 'green',
    size: 12,
  };

  return <Iconoir {...props} />
};

export default App;