feather-icons-react vs react-feather vs react-icons
Reactアイコンライブラリ
feather-icons-reactreact-featherreact-icons類似パッケージ:

Reactアイコンライブラリ

Reactアイコンライブラリは、Reactアプリケーションでアイコンを簡単に使用できるようにするためのパッケージです。これらのライブラリは、さまざまなスタイルやデザインのアイコンを提供し、開発者が視覚的な要素を迅速に追加できるようにします。これにより、ユーザーインターフェースがより魅力的で使いやすくなります。

npmのダウンロードトレンド

3 年

GitHub Starsランキング

統計詳細

パッケージ
ダウンロード数
Stars
サイズ
Issues
公開日時
ライセンス
feather-icons-react048498 kB35ヶ月前ISC
react-feather01,9551 MB38-MIT
react-icons012,53487 MB2441ヶ月前MIT

機能比較: feather-icons-react vs react-feather vs react-icons

アイコンのスタイル

  • feather-icons-react:

    Featherアイコンは、シンプルで洗練されたデザインが特徴で、軽量なSVGアイコンを提供します。これにより、視覚的にクリーンでモダンなユーザーインターフェースを実現できます。

  • react-feather:

    React用に最適化されたFeatherアイコンを提供し、カスタマイズが容易です。アイコンのサイズや色を簡単に変更でき、アプリケーションのスタイルに合わせることができます。

  • react-icons:

    多様なアイコンスタイルを提供し、Font Awesome、Material Iconsなど、さまざまなアイコンセットを統一的に使用できます。これにより、デザインの一貫性を保ちながら、必要なアイコンを選択できます。

カスタマイズ性

  • feather-icons-react:

    SVGアイコンの特性を活かし、CSSで簡単にスタイルを変更できます。色やサイズを自由に調整できるため、デザインに合わせた柔軟なカスタマイズが可能です。

  • react-feather:

    アイコンのプロパティを直接変更できるため、アプリケーションのニーズに応じて簡単にカスタマイズできます。特に、色やサイズの変更が直感的に行えます。

  • react-icons:

    アイコンのサイズや色をプロパティとして指定でき、他のアイコンライブラリと同様のカスタマイズが可能です。これにより、統一感のあるデザインを維持しつつ、必要に応じて調整できます。

パフォーマンス

  • feather-icons-react:

    軽量なSVGアイコンを使用しているため、アプリケーションのパフォーマンスに与える影響が少なく、迅速な描画が可能です。

  • react-feather:

    Reactコンポーネントとして提供されるため、必要なアイコンのみをレンダリングし、パフォーマンスを最適化できます。

  • react-icons:

    多くのアイコンを一括でインポートすることができ、必要なアイコンだけを選択して使用することで、アプリケーションのパフォーマンスを向上させることができます。

使用の簡便さ

  • feather-icons-react:

    シンプルなAPIを提供しており、アイコンを簡単にインポートして使用できます。特別な設定は不要で、すぐに利用可能です。

  • react-feather:

    Reactのコンポーネントとして簡単に使用でき、直感的なプロパティ設定でアイコンをカスタマイズできます。

  • react-icons:

    多様なアイコンセットを一つのライブラリで管理できるため、異なるアイコンライブラリを使用する手間が省け、簡単にアイコンを切り替えられます。

コミュニティとサポート

  • feather-icons-react:

    Featherアイコンは広く使用されており、コミュニティからのサポートが充実しています。ドキュメントも整備されているため、導入がスムーズです。

  • react-feather:

    Reactに特化したサポートがあり、Reactのエコシステムに適した情報が得やすいです。

  • react-icons:

    多くのユーザーがいるため、問題解決のためのリソースやサポートが豊富です。また、他のアイコンライブラリとの互換性があるため、柔軟に対応できます。

選び方: feather-icons-react vs react-feather vs react-icons

  • feather-icons-react:

    Featherアイコンのスタイルが気に入っている場合や、軽量でシンプルなアイコンを必要とする場合に選択してください。

  • react-feather:

    Reactに特化したFeatherアイコンを使用したい場合や、簡単にカスタマイズできるアイコンが必要な場合に選択してください。

  • react-icons:

    多様なアイコンセットを探している場合や、他のアイコンライブラリ(Font AwesomeやMaterial Iconsなど)を統一的に使用したい場合に選択してください。

feather-icons-react のREADME

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