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 Events
In React, events are actions that occur within an application, such as clicking a button, typing in a text field, or moving the mouse. React provides an efficient way to handle these actions using its event system. Event handlers like onClick, onChange, and onSubmit are used to capture and respond t
8 min read
React JSX
JSX stands for JavaScript XML, and it is a special syntax used in React to simplify building user interfaces. JSX allows you to write HTML-like code directly inside JavaScript, enabling you to create UI components more efficiently. Although JSX looks like regular HTML, itâs actually a syntax extensi
6 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
React MUI Components
React MUI is a UI library that provides fully-loaded components, bringing our own design system to our production-ready components. MUI is a user interface library that provides predefined and customizable React components for faster and easy web development, these Material-UI components are based o
4 min read
React Desktop
React Desktop is a popular library built on top of React.js to bring the native desktop experience to the web. It is a cross-platform desktop development library to provides macOS and Windows OS components. React DesktopWhy React Desktop? This library provides macOS and Windows OS components. These
2 min read
React Suite Introduction
React Suite is a popular front-end library with a set of React components that are designed for the middle platform and back-end products. It is a developer-friendly UI framework. Installation: You can install it with the following command: npm i rsuite // or yarn add rsuite Now you can import suite
3 min read
ReactJS PropTypes
In ReactJS PropTypes are the property that is mainly shared between the parent components to the child components. It is used to solve the type validation problem. Since in the latest version of the React 19, Prototype has been removed. What is ReactJS PropTypes?PropTypes is a tool in React that hel
5 min read