React-icons is a library that provides popular and customizable icons for react applications. It is easy to integrate in the project and we can include any number of icons in our project.
Prerequisites
Approach
To use icons in our react project we will install the react-icons library from NPM as a project dependency. Then we can directly import any icon of out choice and use in the react app.
Steps to Use React Icons
Below all the steps are described order wise how to add icons and design them in existing React project.
Step 1: Install the React Icons Package
install the react icons library from npm using the below command
npm install react-icons --save
The updated dependencies in package.json file
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
Step 2: Modify the App.js file
After installing icons library, now open your App.js file which is present inside your project directory's, under src folder and delete code preset inside it.
Step 3: Choose the icons to be used from the react-icons
Now open react-icons library by visiting the below link. This is inbuilt library of react-icons which is provided by react. After opening react-icons, now from menu select category and name of icon you want to add. After clicking, on right hand side you will see many icons and there names. In category I am selecting Game icons, and from right hand side I am selecting GiPoliceBadge you can choose any other if you want.
https://react-icons.github.io/react-icons/icons?name=gi
Step 4: Import and use the selected icon
Now in your aApp.js file, add this code:
import { IconName } from "react-icons/";
Example: This example demonstrates using icons form react-icon library.
JavaScript
// Filename - App.js
import React, { Component } from "react";
// gi is sort name of game icon.
import { GiPoliceBadge } from "react-icons/gi";
// The GiPoliceBadge is icon name.
class App extends Component {
render() {
return (
<div>
<GiPoliceBadge />
</div>
);
}
}
export default App;
Output:
- To see output run below command.
npm start
- Now, after npm started successfully , open browser and type below url to see output.
http://localhost:3000/

Example: This article demonstrate changing the color of Icons and size.
JavaScript
// Filename - App.js
import React, { Component } from "react";
// gi is sort name of game icon.
import { GiPoliceBadge } from "react-icons/gi";
// The GiPoliceBadge is icon name.
class App extends Component {
render() {
return (
<div>
<GiPoliceBadge size="100px" color="green"/>
</div>
);
}
}
export default App;
Output:

Example: This example demonstrates adding multiple icons in from react-icons.
JavaScript
// Filename - App.js
import React, { Component } from "react";
// gi is sort name of game icon.
import { GiPoliceBadge } from "react-icons/gi";
import { MdAndroid } from "react-icons/md";
import { GoBroadcast } from "react-icons/go";
import { FaAmazon } from "react-icons/fa";
// The GiPoliceBadge is icon name.
class App extends Component {
render() {
return (
<div>
<GiPoliceBadge size="50px" color="green"/>
<MdAndroid size="50px" color="yellow" />
<GoBroadcast size="50px" color="purple"/>
<FaAmazon size="50px" color="black" />
</div>
);
}
}
export default App;
Output:

Summary
React Icons library simplify using icons in the react project by providing easy to use react component. We can access multiple popular icons along with customizable styles and colors by integrating it in out react project.
Similar Reads
React Components In React, React components are independent, reusable building blocks in a React application that define what gets displayed on the UI. They accept inputs called props and return React elements describing the UI.In this article, we will explore the basics of React components, props, state, and render
4 min read
React Introduction ReactJS is a component-based JavaScript library used to build dynamic and interactive user interfaces. It simplifies the creation of single-page applications (SPAs) with a focus on performance and maintainability.It is developed and maintained by Facebook.The latest version of React is React 19.Uses
8 min read
What is React? React JS is a free library for making websites look and feel cool. It's like a special helper for JavaScript. People from Facebook and other communities work together to keep it awesome and up-to-date. React is Developed by Facebook, React is a powerful JavaScript library used for building user inte
6 min read
React Quiz If you're looking to test and strengthen your understanding of React, you're in the right place! This React Quiz is designed to help you assess your knowledge of React, from the basics like components and state management to more advanced topics like hooks, context, and performance optimization.Whet
2 min read
ReactJS Reactstrap Reactstrap is a React component library for Bootstrap. Reactstrap is a bootstrap-based React UI library that is used to make good-looking webpages with its seamless and easy-to-use component. Reactstrap does not embed its style, but it depends upon the Bootstrap CSS framework for its styles and them
2 min read
ReactJS ReactDOMClient Methods for initializing an app on the client are provided by the react-dom/client package. The majority of your components shouldn't require the use of this module. Install the required package: Client-specific initialization techniques are available in the react-dom/client package. The majority of
4 min read