React SVG Icon Loader is a lightweight React component library for easily incorporating SVG icons into your React applications. It simplifies the process of using SVG icons by providing a convenient and customizable way to display them.
You can install the package using npm or yarn:
npm install react-svg-icons-loader
or
yarn add react-svg-icons-loader
In this example, you can use the Icon
component directly to render SVG icons:
import React from 'react';
import Icon from 'react-svg-icons-loader';
function Example1() {
return (
<div>
<Icon name="Hierarchical" size={100} color="blue" />
<Icon name="Businessman" size={100} color="blue" />
</div>
);
}
export default Example1;
Alternatively, you can import specific icons directly and use them in your components:
import React from 'react';
import { Businessman, Hierarchical } from 'react-svg-icons-loader';
function Example2() {
return (
<div>
<Hierarchical size={100} color="blue" />
<Businessman size={100} color="blue" />
</div>
);
}
export default Example2;
The Icon
component and individual icon components (Businessman
, Hierarchical
, etc.) support the following props:
-
name
(string): The name of the icon to be displayed. -
size
(number): The size of the icon in pixels. -
color
(string): The color of the icon.
The following icons are available for use:
Hierarchical
Businessman
This project is licensed under the MIT License - see the LICENSE file for details.
If you'd like to contribute to this project, please follow the contribution guidelines.
If you encounter any issues or have suggestions for improvement, please open an issue on the GitHub repository.