feather-icons-react vs react-feather vs react-icons
React Icon Libraries
feather-icons-reactreact-featherreact-iconsSimilar Packages:

React Icon Libraries

Icon libraries in React provide developers with a collection of scalable vector icons that can be easily integrated into applications. These libraries offer a range of icons that can be customized in terms of size, color, and style, enhancing the visual appeal and usability of web applications. Utilizing icon libraries can significantly speed up development time by providing pre-designed assets that are ready to use, ensuring consistency in design and reducing the need for custom icon creation.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
feather-icons-react048498 kB35 months agoISC
react-feather01,9551 MB38-MIT
react-icons012,53487 MB244a month agoMIT

Feature Comparison: feather-icons-react vs react-feather vs react-icons

Design Philosophy

  • feather-icons-react:

    Feather icons are designed with a focus on simplicity and clarity. They are outlined icons that emphasize a minimalist approach, making them suitable for applications that aim for a clean and modern look.

  • react-feather:

    React-feather maintains the minimalist philosophy of Feather icons while providing the flexibility to customize each icon's appearance. This package allows developers to easily adjust properties like stroke width and color, enhancing the adaptability of icons within various design contexts.

  • react-icons:

    React-icons aggregates multiple icon libraries, offering a diverse range of styles and designs. This means developers can choose icons that best fit their application's aesthetic, whether they prefer flat, outlined, or filled styles.

Customization

  • feather-icons-react:

    Customization in feather-icons-react is straightforward, as it allows developers to change the size and color of icons using standard CSS properties. However, it does not provide extensive options for altering the icon shapes themselves.

  • react-feather:

    React-feather offers more extensive customization options, allowing developers to modify attributes such as stroke color, width, and even the icon's viewBox. This flexibility makes it easier to adapt icons to fit specific design requirements without compromising their integrity.

  • react-icons:

    React-icons provides a broad range of icons from various libraries, each with its own customization capabilities. This means that while some icons may offer extensive customization options, others may be more limited, depending on the original library's design.

Performance

  • feather-icons-react:

    Feather-icons-react is optimized for performance, as it includes only the necessary SVG icons without any additional overhead. This ensures that applications using this library remain lightweight and fast.

  • react-feather:

    React-feather is also performance-oriented, providing a minimal footprint by only including the icons that are used in the project. This helps in reducing bundle size and improving load times for applications.

  • react-icons:

    React-icons can potentially increase bundle size since it aggregates multiple icon libraries. However, it allows for tree-shaking, meaning that unused icons can be excluded from the final build, helping to mitigate performance issues.

Ease of Use

  • feather-icons-react:

    Feather-icons-react is easy to use, requiring minimal setup. Developers can quickly import and use icons in their components, making it a great choice for those who want a straightforward solution.

  • react-feather:

    React-feather is similarly user-friendly, with a simple API that allows for quick integration of icons into React applications. Its flexibility in customization makes it appealing for developers who want both ease of use and adaptability.

  • react-icons:

    React-icons offers a slightly steeper learning curve due to its support for multiple icon libraries. However, once familiar, developers can leverage its extensive options to find the perfect icons for their projects.

Community and Support

  • feather-icons-react:

    Feather-icons-react has a growing community, but it is relatively smaller compared to more established libraries. This may affect the availability of community support and resources.

  • react-feather:

    React-feather benefits from the popularity of Feather icons and has a supportive community. Documentation is clear, and developers can find various resources and examples to assist them.

  • react-icons:

    React-icons has a large and active community, providing extensive documentation, tutorials, and support. This makes it easier for developers to find help and resources when needed.

How to Choose: feather-icons-react vs react-feather vs react-icons

  • feather-icons-react:

    Choose feather-icons-react if you prefer a minimalist design aesthetic. This package provides a set of open-source icons that are designed to be simple and elegant, making them ideal for modern web applications that prioritize clean interfaces.

  • react-feather:

    Opt for react-feather if you want a lightweight solution that offers a flexible API for customizing icons. This library wraps Feather icons in React components, allowing for easy integration and manipulation of icon properties, such as size and color, directly in your JSX.

  • react-icons:

    Select react-icons if you need a comprehensive library that includes a wide variety of icon sets from different sources. This package allows you to import icons from multiple libraries, providing greater flexibility and choice, which is beneficial for projects that require diverse iconography.

README for feather-icons-react

Feather Icons React

npm

yarn add feather-icons-react

This package lets you use Feather Icons as a React Component. It currently supports up to version 4.29.0

Usage

You can use the default export and pass the 'icon' prop:

import FeatherIcon from 'feather-icons-react';
<FeatherIcon icon="close" />;

Or you can use the provided named export in place of the icon prop:

import { Close } from 'feather-icons-react';
<Close />;

This gives you the flexibility to dynamically change the icon if you want to use the default export (like in the Toggle Icon example below), or potentially save on size in your application bundle by not having to require all of the icons by using the default export.

Setting a size:

Size can be passed as either string or number.

e.g.: <FeatherIcon icon="copy" size="24" /> or <Copy size={24} />

Sizes can always be easily overridden by CSS.

Setting fill and other properties

Fill defaults to none, but can be passed as a React prop

<FeatherIcon icon="heart" fill="red" />

Addtionally, you can add any other SVG tag properties, and they will pass through.

Setting colors

Use CSS. The icons default to use currentColor. This is equivalent to whatever text color is being used in the icon's container.

Dynamically change icons

Toggle icon example:

const ToggleIconContainer = () => {
  const [icon, setIcon] = useState('x');

  return (
    <div>
      <FeatherIcon icon={icon} />
      <ul>
        <li>
          <button onClick={() => setIcon('x')}>Make the Icon an X</button>
        </li>
        <li>
          <button onClick={() => setIcon('anchor')}>
            Make the Icon an Anchor
          </button>
        </li>
        <li>
          <button onClick={() => setIcon('box')}>Make the Icon a box</button>
        </li>
      </ul>
    </div>
  );
};

The icons are all square, based on a 24x24 grid.

The full list of icon names can be referenced at: feathericons.com

Contributing

To build the bundled assets for consumption yarn build

Updating the icons

If you found a missing icon, it is pretty easy to generate a new icons.json and get a PR up so this package stays in sync with the latest feather icons. Go into your desired project directory (ideally one directory above where you have feather-icons-react saved)

  1. git clone https://github.com/feathericons/feather.git
  2. cd feather && npx install
  3. npx babel-node bin/build-icons-json.js
  4. cp dist/icons.json ../feather-icons-react/src/icons.json
  5. Now open the file you just copied. Format the file, try to avoid entire green so the diff looks neat in the PR.

Alternatively, you can simply copy just the lines from the JSON file you know are missing. This is easier if you're just adding one new icon.

Testing your changes

You can use the demo directory to verify your changes.

Build the main package first (if not already built):

yarn build

Navigate to the demo directory:

cd demo

Install demo dependencies:

yarn install

Start the dev server:

yarn dev

TODO

  • Add tests both to the icon render and the generate icon exports script
  • Automatically generate new icons via script.
    • could copy build-icons-json script from feather-icons