Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-icons

Package Overview
Dependencies
Maintainers
5
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-icons

SVG React icons of popular icon packs using ES6 imports

  • 5.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.5M
increased by1.85%
Maintainers
5
Weekly downloads
 
Created

What is react-icons?

The react-icons package provides a large collection of icons from various icon libraries that can be easily used in React applications. It allows developers to include icons using React components, which can be styled and manipulated like any other React component.

What are react-icons's main functionalities?

Importing and using an icon

This feature allows you to import an icon from a specific icon library (in this case, Font Awesome) and use it as a React component in your application.

import { FaBeer } from 'react-icons/fa';

function App() {
  return <h3> Lets go for a <FaBeer />? </h3>;
}

Styling icons

Icons can be styled using inline styles or CSS classes, just like any other React component. This code sample demonstrates inline styling to change the color and size of the icon.

import { FaBeer } from 'react-icons/fa';

function App() {
  return <FaBeer style={{ color: 'blue', fontSize: '50px' }} />;
}

Combining icons with other components

React-icons can be easily combined with other components, such as buttons from a UI library like React Bootstrap. This allows for more complex and visually appealing components.

import { FaBeer } from 'react-icons/fa';
import { Button } from 'react-bootstrap';

function App() {
  return (
    <Button variant='primary'>
      Order a beer <FaBeer />
    </Button>
  );
}

Other packages similar to react-icons

FAQs

Package last updated on 13 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc