Package Exports
- iconoir-react
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (iconoir-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React Iconoir Icons
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-reactor
npm i iconoir-reactUsage
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;