react-icons vs font-awesome vs heroicons vs material-icons vs react-fontawesome vs remixicon-react
React アプリケーションにおけるアイコンライブラリの選定
react-iconsfont-awesomeheroiconsmaterial-iconsreact-fontawesomeremixicon-react類似パッケージ:

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

font-awesomeheroiconsmaterial-iconsreact-fontawesomereact-iconsremixicon-react は、Web アプリケーションでアイコンを表示するための npm パッケージです。これらのパッケージは、アイコンの提供方法(SVG コンポーネント vs Web フォント)、React との統合度、カスタマイズ性、およびメンテナンス状況において大きく異なります。特に、font-awesomematerial-icons は Web フォントベースのパッケージであり、React 向けのコンポーネントライブラリとしては非推奨です。一方、react-fontawesomeheroiconsreact-iconsremixicon-react は SVG を React コンポーネントとして提供し、ツリーシェイキングや型安全性といった現代的なフロントエンド開発要件を満たしています。

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

3 年

GitHub Starsランキング

統計詳細

パッケージ
ダウンロード数
Stars
サイズ
Issues
公開日時
ライセンス
react-icons8,863,18012,52486.2 MB2391年前MIT
font-awesome076,453-3219年前(OFL-1.1 AND MIT)
heroicons023,420700 kB31年前MIT
material-icons03622.23 MB131年前Apache-2.0
react-fontawesome0667-96年前MIT
remixicon-react0164.58 MB12-(MIT AND OFL-1.1)

React アイコンライブラリの技術的比較:font-awesome、heroicons、material-icons、react-fontawesome、react-icons、remixicon-react

フロントエンド開発でアイコンを扱う際、単に「見栄え」だけでなく、バンドルサイズ、TypeScript サポート、カスタマイズ性、メンテナンス状況など、多くの技術的要素が選定に影響します。この記事では、代表的な6つの npm パッケージについて、実際のコード例を交えながら深く比較します。

⚠️ 非推奨パッケージの確認

まず重要な前提として、font-awesome(npm パッケージ名)と material-icons は、React 向けのコンポーネントライブラリとしては非推奨または用途が異なることに注意が必要です。

  • font-awesome: このパッケージは Font Awesome の CSS/フォントファイルを提供するもので、React コンポーネントではありません。公式ドキュメントでも、React での使用には @fortawesome/react-fontawesome を使うよう明記されています。
  • material-icons: Google 公式の Material Icons フォントをインストールするためのパッケージであり、SVG コンポーネントではなく Web フォントベースです。そのため、React での柔軟なスタイル制御や SSR 対応に制限があります。

これらのパッケージは、新規 React プロジェクトでは直接使用すべきではありません。代わりに、それぞれ対応する React 専用ラッパー(react-fontawesomereact-icons 内の Material Icons)を利用すべきです。

🧩 コンポーネント形式 vs Web フォント

アイコンライブラリは大きく2種類に分けられます:

  1. SVG コンポーネントベース(例: heroicons, react-icons, remixicon-react

    • アイコンが React コンポーネントとして提供される
    • スタイル(色、サイズなど)を props で自由に変更可能
    • ツリーシェイキングにより未使用アイコンはバンドルに含まれない
  2. Web フォントベース(例: font-awesome + CSS, material-icons

    • <i class="fas fa-user"></i> のような HTML 要素で表示
    • CSS 依存が強く、React の宣言的 UI との親和性が低い
    • 全アイコンがフォントファイルとして読み込まれる(バンドル最適化が難しい)

React プロジェクトでは、SVG コンポーネントベースが圧倒的に推奨されます

🔌 実装方法の比較

react-fontawesome(Font Awesome の React 専用ラッパー)

Font Awesome のアイコンを React コンポーネントとして使うには、react-fontawesome と個別のアイコンセット(例: @fortawesome/free-solid-svg-icons)を組み合わせます。

import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faUser } from '@fortawesome/free-solid-svg-icons';

function App() {
  return <FontAwesomeIcon icon={faUser} size="lg" color="blue" />;
}
  • アイコンは JavaScript オブジェクトとして import
  • size, color, spin などの props でカスタマイズ可能
  • ツリーシェイキング対応(使ったアイコンだけがバンドルされる)

heroicons(Tailwind CSS 公式アイコン)

SVG パスを直接 React コンポーネントとしてエクスポート。シンプルで軽量。

import { UserIcon } from '@heroicons/react/24/outline';

function App() {
  return <UserIcon className="w-6 h-6 text-blue-500" />;
}
  • 24/outline, 24/solid, 20/solid など、サイズとスタイルごとにパスが分かれている
  • className で Tailwind CSS クラスを直接適用可能
  • TypeScript 完全対応、props は標準 SVG 属性のみ

material-icons(Web フォント版 — 非推奨)

Google 公式の Web フォントを使う方法。React では不向き。

// ❌ 非推奨: Web フォント依存、SSR で FOUC 発生の可能性
import 'material-icons/iconfont/material-icons.css';

function App() {
  return <i className="material-icons">account_circle</i>;
}
  • アイコン名は文字列で指定(型安全でない)
  • 色やサイズは CSS でしか制御できない
  • 全アイコンがフォントファイルに含まれる(約100KB+)

✅ 代わりに react-icons 経由で Material Icons を使うのがベストプラクティス(後述)。

react-icons(統合アイコンライブラリ)

複数のアイコンセット(Fa, Io, Md, Ri など)を1つのインターフェースで提供。

import { FaUser, MdAccountCircle, RiUser3Fill } from 'react-icons/all';

function App() {
  return (
    <div>
      <FaUser size="24px" color="red" />
      <MdAccountCircle size={24} className="text-green-500" />
      <RiUser3Fill style={{ width: '24px', height: '24px' }} />
    </div>
  );
}
  • 全アイコンが個別に import 可能(ツリーシェイキング対応)
  • 共通 props: size, color, className, style
  • 1つのプロジェクトで複数のデザインシステムを混在可能

remixicon-react(Remix Icon の React 専用版)

Remix Icon の SVG を React コンポーネント化したもの。

import { User3Fill } from 'remixicon-react';

function App() {
  return <User3Fill size="24" color="#3b82f6" />;
}
  • sizecolor props で基本カスタマイズ
  • アイコン名は元の Remix Icon と一致(例: User3Fill
  • TypeScript 定義付き

🎨 カスタマイズ性とスタイル制御

パッケージ色変更サイズ変更追加スタイル型安全性
react-fontawesome✅ (color)✅ (size or className)✅ (className, style)
heroicons✅ (className/style)✅ (className/style)✅ (className, style)
material-icons (Web font)❌ (CSS only)❌ (CSS only)⚠️ (CSS 依存)
react-icons✅ (color)✅ (size)✅ (className, style)
remixicon-react✅ (color)✅ (size)✅ (style)

heroicons は Tailwind CSS ユーザー向けに最適化されており、className での制御が自然です。一方、react-iconsreact-fontawesome は汎用的な props を提供し、CSS-in-JS や styled-components との相性も良いです。

📦 バンドルサイズとパフォーマンス

  • heroicons, remixicon-react, react-fontawesome: 使ったアイコンだけがバンドルされる(tree-shakable)
  • react-icons: 同様に tree-shakable。ただし、内部で各アイコンセットをサブディレクトリに分けており、import パスに注意
  • font-awesome (CSS版), material-icons (Web font): 全アイコンがフォントファイルとして読み込まれるため、初期ロードが重い

特にモバイル向けやパフォーマンス重視のアプリでは、SVG コンポーネントベースの選択が必須です。

🛠️ 実用的な使用例

ケース1: Tailwind CSS を使ったプロジェクト

heroicons が最も自然に統合できます。

import { BellIcon } from '@heroicons/react/24/outline';

function NotificationButton() {
  return (
    <button className="p-2 rounded-full hover:bg-gray-100">
      <BellIcon className="w-5 h-5 text-gray-700" />
    </button>
  );
}

ケース2: 複数のアイコンセットを混在させたい

react-icons が最適です。

import { FaGithub, FiTwitter, AiFillLinkedin } from 'react-icons/all';

function SocialLinks() {
  return (
    <div className="flex space-x-4">
      <FaGithub size={20} />
      <FiTwitter size={20} />
      <AiFillLinkedin size={20} />
    </div>
  );
}

ケース3: Font Awesome に既に依存している既存プロジェクト

react-fontawesome を使って段階的に移行。

import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCoffee, faCode } from '@fortawesome/free-solid-svg-icons';

function Features() {
  return (
    <div>
      <FontAwesomeIcon icon={faCoffee} className="mr-2" />
      <FontAwesomeIcon icon={faCode} className="ml-2" />
    </div>
  );
}

🚫 避けるべきパターン

  • font-awesome パッケージを React で直接使う → CSS ベースのため、SSR やスタイル制御で問題が起きやすい
  • material-icons を Web フォントとして使う → アイコン名が文字列のため型安全でなく、バンドルも重い

これらは、必ず react-fontawesomereact-icons 経由で使うべきです。

📊 まとめ:選定ガイド

パッケージ推奨シナリオ注意点
react-fontawesome既に Font Awesome を使っているプロジェクト、豊富なアイコンが必要別途アイコンセットの npm パッケージが必要
heroiconsTailwind CSS ユーザー、シンプルでモダンなデザインアイコン数は他より少ない
material-icons新規プロジェクトでは非推奨Web フォントベースのため React に不向き
react-icons複数のアイコンセットを1つで管理したい、柔軟性重視パッケージが大きめだが、ツリーシェイキングで解決
remixicon-reactRemix Icon のデザインが気に入っている場合コミュニティ規模は react-icons より小さい
font-awesome (CSS版)React プロジェクトでは使用禁止React コンポーネントではない

💡 最終的なアドバイス

  • 新規プロジェクトなら、heroicons(Tailwind ユーザー)か react-icons(汎用性重視)が安全牌
  • 既存の Font Awesome 依存があるなら、react-fontawesome で移行
  • 絶対に避けるべきは、font-awesomematerial-icons をそのまま React で使うこと — これらは Web フォント用パッケージであり、React の宣言的 UI モデルと相性が悪い

アイコンは小さなUI要素ですが、選定ミスは長期的な技術的負債になります。パフォーマンス、保守性、開発体験のバランスを考えて、適切なパッケージを選びましょう。

選び方: react-icons vs font-awesome vs heroicons vs material-icons vs react-fontawesome vs remixicon-react

  • react-icons:

    複数のアイコンセット(Font Awesome, Ionicons, Material Design Icons, Remix Icon など)を1つの統一されたインターフェースで利用したい場合に最適です。個々のアイコンを個別に import でき、ツリーシェイキングによるバンドル最適化が可能です。汎用性が高く、デザインシステムをまだ固定していないプロジェクトや、特定のアイコンセットに縛られたくない場合に非常に有用です。

  • font-awesome:

    font-awesome パッケージは Web フォント(CSS/フォントファイル)を提供するものであり、React コンポーネントではありません。React プロジェクトで Font Awesome を使いたい場合は、代わりに react-fontawesome を使用してください。このパッケージは新規プロジェクトでの使用を避けるべきです。

  • heroicons:

    Tailwind CSS を使用しているプロジェクトや、シンプルで一貫性のあるデザインシステムを求める場合に最適です。アイコンは SVG コンポーネントとして提供され、className で Tailwind クラスを直接適用できるため、開発体験が非常にスムーズです。ただし、アイコンの総数は他のライブラリに比べて少ないため、多様なアイコンが必要なケースでは物足りないかもしれません。

  • material-icons:

    material-icons パッケージは Google 公式の Material Icons Web フォントをインストールするもので、React 向けのコンポーネントライブラリではありません。アイコン名を文字列で指定する必要があり型安全性に欠け、全アイコンがフォントファイルとして読み込まれるためバンドルサイズも大きくなります。新規 React プロジェクトでは使用せず、代わりに react-icons 経由で Material Icons を利用することを推奨します。

  • react-fontawesome:

    既に Font Awesome のアイコンセットに依存しているプロジェクトや、豊富なアイコンバリエーション(Regular, Solid, Brands など)が必要な場合に適しています。SVG コンポーネントとして提供され、sizecolor などの props でカスタマイズ可能で、ツリーシェイキングにも対応しています。ただし、アイコンごとに個別の npm パッケージ(例: @fortawesome/free-solid-svg-icons)を追加インストールする必要があります。

  • remixicon-react:

    Remix Icon のデザインが好みで、そのアイコンセットを React コンポーネントとして使いたい場合に適しています。SVG ベースで sizecolor props によるカスタマイズが可能で、TypeScript サポートも含まれています。ただし、コミュニティ規模やドキュメントの充実度は react-iconsheroicons に比べるとやや劣る可能性があるため、長期的なメンテナンス観点で検討が必要です。

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.