react-icons vs react-feather
React アプリケーションにおけるアイコンライブラリの選択
react-iconsreact-feather類似パッケージ:

React アプリケーションにおけるアイコンライブラリの選択

react-featherreact-icons は、React アプリケーションでベクター形式のアイコンを簡単に使用するためのライブラリです。react-feather は Feather Icons の公式 React 実装であり、一貫したスタイルを持つ軽量なアイコンセットを提供します。一方、react-icons は複数の人気アイコンセット(Feather Icons を含む)を単一のパッケージで利用可能にし、必要なアイコンだけを個別にインポートできる柔軟性を持っています。両方とも SVG ベースで、CSS によるスタイリングが容易です。

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

3 年

GitHub Starsランキング

統計詳細

パッケージ
ダウンロード数
Stars
サイズ
Issues
公開日時
ライセンス
react-icons5,918,33912,50386.2 MB2321年前MIT
react-feather323,9511,9571 MB38-MIT

react-feather vs react-icons: アイコン管理の設計戦略比較

React アプリでアイコンを使うとき、react-featherreact-icons はよく検討される選択肢です。どちらも SVG アイコンを React コンポーネントとして提供しますが、アーキテクチャや使い勝手には明確な違いがあります。実際の開発現場での判断材料になるよう、技術的な観点から詳しく見ていきましょう。

🎨 アイコンセットの範囲:単一 vs 複数

react-feather は Feather Icons 専用のラッパーです。1つの統一されたビジュアル言語(細めの線、丸みのある角)しか提供しません。

// react-feather
import { Heart, Star } from 'react-feather';

function App() {
  return (
    <div>
      <Heart color="red" size={24} />
      <Star fill="gold" size={20} />
    </div>
  );
}

react-icons は複数のアイコンセットを統合しています。Feather だけでなく、FontAwesome、Material Icons、Lucide など 20 種類以上のセットを利用可能です。

// react-icons
import { FiHeart } from 'react-icons/fi'; // Feather
import { FaStar } from 'react-icons/fa'; // FontAwesome

function App() {
  return (
    <div>
      <FiHeart color="red" size={24} />
      <FaStar color="gold" size={20} />
    </div>
  );
}

💡 注意:react-icons では各アイコンセットごとにサブパス(例:/fi, /fa)を指定してインポートします。これにより、未使用のアイコンはバンドルに含まれません。

📦 バンドルサイズとインポート戦略

react-feather は全アイコンを一度にインポートする方式を採用しています。たとえ1つだけ使ったとしても、全アイコンのコードがバンドルに含まれる可能性があります(ただし、最新のビルドツールで tree-shaking が効く場合もあります)。

// 全アイコンが潜在的にバンドル対象になる
import { Camera, Settings } from 'react-feather';

react-icons は「1アイコン=1モジュール」の設計です。使うアイコンだけを個別にインポートするため、不要なコードがバンドルに混入することはありません。

// 必要最小限のコードのみがバンドルされる
import { MdCamera } from 'react-icons/md';
import { IoSettings } from 'react-icons/io';

この違いは、特に大規模アプリやパフォーマンスが重要なプロジェクトで顕著になります。

⚙️ API とカスタマイズ性

両方とも共通の props(size, color, className など)をサポートしており、基本的なスタイリングはほぼ同じように記述できます。

// どちらも同じ props を受け付ける
<Icon size={32} color="#333" className="custom-icon" />

ただし、react-featherstrokeWidthstrokeLinecap といった SVG 固有の属性を直接渡せる点が特徴です。Feather アイコンの線の太さなどを細かく調整したい場合に便利です。

// react-feather での詳細制御
<Heart strokeWidth={1.5} strokeLinecap="round" />

一方、react-icons は各アイコンセットの元のデザインを尊重しており、SVG 属性の直接操作は推奨されていません。代わりに、CSS や style prop での調整が一般的です。

🔧 メンテナンスと将来性

公式ドキュメントおよび npm ページを確認したところ、両ライブラリとも現在もアクティブにメンテナンスされています。非推奨(deprecated)の通知はなく、新規プロジェクトでの使用に問題はありません。

ただし、react-feather は Feather Icons 自体の更新頻度に依存します。一方、react-icons は複数のソースを統合しているため、特定のアイコンセットが更新されればすぐに追随可能です。

🛠 実践的な選定ガイド

ケース1: デザインシステムが厳格に定義されている社内ツール

  • 選ぶべきは: react-feather
  • 理由: Feather の一貫したビジュアル言語が既に承認されており、追加のアイコンセットは不要。シンプルな依存関係が保守コストを下げます。

ケース2: 複数のブランドや顧客向けにカスタマイズ可能な SaaS 製品

  • 選ぶべきは: react-icons
  • 理由: 顧客ごとに異なるアイコンセット(例:Material が好きな企業 vs FontAwesome が好きな企業)をサポートする必要がある。柔軟な切り替えが可能。

ケース3: パフォーマンスが最重要なモバイル向け PWA

  • 選ぶべきは: react-icons
  • 理由: 使用するアイコンだけをバンドルできるため、初期ロードサイズを最小限に抑えられる。

📊 まとめ:主な違い

項目react-featherreact-icons
アイコンセットFeather のみ20+ セット(Feather 含む)
バンドル戦略全アイコンが対象(tree-shaking 依存)使用アイコンのみ
インポート方法import { Icon } from 'react-feather'import { FiIcon } from 'react-icons/fi'
詳細 SVG 制御可能(strokeWidth など)非推奨(CSS 推奨)
ユースケース単一デザイン言語のプロジェクト多様なアイコンニーズがあるプロジェクト

💡 最終的なアドバイス

  • シンプルさと一貫性が最優先なら → react-feather
  • 柔軟性と拡張性が重要なら → react-icons

どちらを選んでも、React でのアイコン管理は十分に成熟した解決策です。プロジェクトのスケール、デザイン要件、パフォーマンス目標を照らし合わせて判断してください。

選び方: react-icons vs react-feather

  • react-icons:

    react-icons は、複数のアイコンセット(Feather、FontAwesome、Material Design など)を一つのインターフェースで扱いたい場合に最適です。必要に応じてアイコンを個別にインポートできるため、バンドルサイズを抑えつつ多様なデザインニーズに対応できます。大規模アプリやデザインガイドラインが複雑なプロジェクトで特に有効です。

  • react-feather:

    react-feather は、Feather Icons のみを使用し、シンプルで一貫性のあるデザインが必要なプロジェクトに向いています。依存関係が少なく、API も最小限のため、軽量さとシンプルさを重視する場合に適しています。ただし、他のアイコンセットを使いたい場合は別のライブラリを追加する必要があります。

react-icons のREADME

React Icons

React Icons

npm

Include popular icons in your React projects easily with react-icons, which utilizes ES6 imports that allows you to include only the icons that your project is using.

Installation (for standard modern project)

yarn add react-icons
# or
npm install react-icons --save

example usage

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

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

View the documentation for further usage examples and how to use icons from other packages. NOTE: each Icon package has it's own subfolder under react-icons you import from.

For example, to use an icon from Material Design, your import would be: import { ICON_NAME } from 'react-icons/md';

Installation (for meteorjs, gatsbyjs, etc)

Note This option has not had a new release for some time. More info https://github.com/react-icons/react-icons/issues/593

If your project grows in size, this option is available. This method has the trade-off that it takes a long time to install the package.

yarn add @react-icons/all-files
# or
npm install @react-icons/all-files --save

example usage

import { FaBeer } from "@react-icons/all-files/fa/FaBeer";

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

Icons

Icon LibraryLicenseVersionCount
Circum IconsMPL-2.0 license1.0.0288
Font Awesome 5CC BY 4.0 License5.15.4-3-gafecf2a1612
Font Awesome 6CC BY 4.0 License6.5.22045
Ionicons 4MIT4.6.3696
Ionicons 5MIT5.5.41332
Material Design iconsApache License Version 2.04.0.0-98-g9beae745bb4341
TypiconsCC BY-SA 3.02.1.2336
Github Octicons iconsMIT18.3.0264
FeatherMIT4.29.1287
LucideISCv5.1.0-6-g438f572e1215
Game IconsCC BY 3.012920d6565588f0512542a3cb0cdfd36a497f9104040
Weather IconsSIL OFL 1.12.0.12219
DeviconsMIT1.8.0192
Ant Design IconsMIT4.4.2831
Bootstrap IconsMIT1.11.32716
Remix IconApache License Version 2.04.2.02860
Flat Color IconsMIT1.0.2329
Grommet-IconsApache License Version 2.04.12.1635
HeroiconsMIT1.0.6460
Heroicons 2MIT2.1.3888
Simple IconsCC0 1.0 Universal12.14.03209
Simple Line IconsMIT2.5.5189
IcoMoon FreeCC BY 4.0 Licensed006795ede82361e1bac1ee76f215cf1dc51e4ca491
BoxIconsMIT2.1.41634
css.ggMIT2.1.1704
VS Code IconsCC BY 4.00.0.35461
Tabler IconsMIT3.2.05237
Themify IconsMITv0.1.2-2-g9600186352
Radix IconsMIT@radix-ui/react-icons@1.3.0-1-g94b3fcf318
Phosphor IconsMIT2.1.19072
Icons8 Line AwesomeMIT1.3.11544

You can add more icons by submitting pull requests or creating issues.

Configuration

You can configure react-icons props using React Context API.

Requires React 16.3 or higher.

import { IconContext } from "react-icons";

<IconContext.Provider value={{ color: "blue", className: "global-class-name" }}>
  <div>
    <FaFolder />
  </div>
</IconContext.Provider>;
KeyDefaultNotes
colorundefined (inherit)
size1em
classNameundefined
styleundefinedCan overwrite size and color
attrundefinedOverwritten by other attributes
titleundefinedIcon description for accessibility

Migrating from version 2 -> 3

Change import style

Import path has changed. You need to rewrite from the old style.

// OLD IMPORT STYLE
import FaBeer from "react-icons/lib/fa/beer";

function Question() {
  return (
    <h3>
      Lets go for a <FaBeer />?
    </h3>
  );
}
// NEW IMPORT STYLE
import { FaBeer } from "react-icons/fa";

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

Ending up with a large JS bundle? Check out this issue.

Adjustment CSS

From version 3, vertical-align: middle is not automatically given. Please use IconContext to specify className or specify an inline style.

Global Inline Styling

<IconContext.Provider value={{ style: { verticalAlign: 'middle' } }}>

Global className Styling

Component

<IconContext.Provider value={{ className: 'react-icons' }}>

CSS

.react-icons {
  vertical-align: middle;
}

TypeScript native support

Dependencies on @types/react-icons can be deleted.

Yarn

yarn remove @types/react-icons

NPM

npm remove @types/react-icons

Contributing

./build-script.sh will build the whole project. See also CI scripts for more information.

Development

yarn
cd packages/react-icons
yarn fetch  # fetch icon sources
yarn build

Add/Update icon set

First, check the discussion to see if anyone would like to add an icon set.

https://github.com/react-icons/react-icons/discussions/categories/new-icon-set

The SVG files to be fetched are managed in this file. Edit this file and run yarn fetch && yarn check && yarn build.

https://github.com/react-icons/react-icons/blob/master/packages/react-icons/src/icons/index.ts

Preview

Note The project is not actively accepting PR for the preview site at this time.

The preview site is the react-icons website, built in Astro+React.

cd packages/react-icons
yarn fetch
yarn build

cd ../preview-astro
yarn start

Demo

The demo is a Create React App boilerplate with react-icons added as a dependency for easy testing.

cd packages/react-icons
yarn fetch
yarn build

cd ../demo
yarn start

Why React SVG components instead of fonts?

SVG is supported by all major browsers. With react-icons, you can serve only the needed icons instead of one big font file to the users, helping you to recognize which icons are used in your project.

Related Projects

Licence

MIT

  • Icons are taken from the other projects so please check each project licences accordingly.