React Icons in 2026: react-icons vs lucide-react and More

Which React icon package to install: react-icons, lucide-react, Heroicons, Phosphor, Tabler or Iconify. Icon counts, licenses, imports and SVG output.

Amit Yadav
7 min read
On this page

For most React apps, install the package of the one icon set your design uses: lucide-react is the common default, with @heroicons/react, @phosphor-icons/react and @tabler/icons-react as the main alternatives. Use react-icons only when you need to mix many sets from one package, and know that its bundled copies lag behind the upstream sets.

Quick answer

  • react-icons is one npm package that bundles many icon sets behind subpath imports such as react-icons/fa or react-icons/lu. Good for mixing sets, but each set is a snapshot.
  • lucide-react renders each icon as an inline SVG: 24x24 viewBox, stroke currentColor, stroke width 2. It sets aria-hidden on icons by default since v1.
  • Per-set packages (Lucide, Heroicons, Phosphor, Tabler) track their upstream set directly and are tree-shakable with named imports.
  • @iconify/react reaches any Iconify set with one component, but fetches icon data from the Iconify API at runtime unless you bundle it.
  • Next.js setup (optimizePackageImports, SVGR, next/image) is in the separate Next.js guide.

The packages compared

Icon counts are for the full upstream set, from our pack data. Versions are the current npm releases on the update date.

PackageIcon setIconsLicenseDefault sizeImport
lucide-react 1.xLucideabout 1,890ISC24pximport { Search } from 'lucide-react'
@heroicons/react 2.xHeroicons1,288 (4 styles)MITset with CSSimport { BeakerIcon } from '@heroicons/react/24/outline'
@phosphor-icons/react 2.xPhosphor9,072 (1,512 x 6 weights)MIT1emimport { HeartIcon } from '@phosphor-icons/react'
@tabler/icons-react 3.xTablerabout 6,200MIT24pximport { IconArrowLeft } from '@tabler/icons-react'
react-icons 5.xmany setsdepends on setMIT (each set keeps its own license)1emimport { FaBeer } from 'react-icons/fa'
@iconify/react 6.xany Iconify set200+ setsMIT1em<Icon icon="lucide:search" />

Heroicons ships four styles as separate import paths: @heroicons/react/24/outline, /24/solid, /20/solid and /16/solid (from the package's exports map). Tabler's props are size, color and stroke, per the Tabler React README.

react-icons vs a per-set package

react-icons is the package most people mean when they search "react icons". It is one install with a subfolder per set: react-icons/fa for Font Awesome, react-icons/md for Material Design, react-icons/lu for Lucide, react-icons/hi2 for Heroicons 2, and so on, per the react-icons README. Named imports keep only the icons you use.

The trade-off is freshness. The README's own table lists the bundled snapshot of each set, and several are behind upstream:

SetBundled in react-icons (README)Upstream today
Lucide1,215 iconsabout 1,890
Heroicons 2v2.1.3v2.2.0
Tabler5,237 icons (v3.2.0)about 6,200
Phosphor9,072 icons9,072

Global defaults go through IconContext.Provider with color, size, className, style, attr and title. If you use one set and want new icons as they ship, use that set's own package. The full head-to-head is in react-icons vs lucide-react.

How lucide-react renders icons

Each Lucide icon is a React component that renders one inline <svg> element, so icons inherit text color and scale with props, per the lucide-react docs. The default attributes in lucide-react 1.61 are:

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
  viewBox="0 0 24 24" fill="none" stroke="currentColor"
  stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  class="lucide lucide-search" aria-hidden="true">
  <!-- paths -->
</svg>

What that means in practice:

  • Props: size, color, strokeWidth and absoluteStrokeWidth, plus any SVG attribute (className, onClick, aria-label).
  • Names: every icon is exported three ways, for example Search, SearchIcon and LucideSearch. Pick one style per codebase.
  • Accessibility: since v1, icons get aria-hidden="true" by default, per the Lucide v1 release notes. Pass aria-label or title when an icon carries meaning on its own.
  • Global defaults: v1 added LucideProvider for size, color and stroke width across a subtree.
  • Brand icons are gone in v1 (GitHub, Figma, Slack and others). Use Simple Icons for logos.
import { LucideProvider, Search, Bell } from 'lucide-react';

export function Toolbar() {
  return (
    <LucideProvider size={20} strokeWidth={1.75}>
      <Search />
      <Bell className="text-amber-500" />
    </LucideProvider>
  );
}

For icon names that come from data, lucide-react/dynamic exports DynamicIcon with a name prop. It loads icons on demand, so use it only where a static import is not possible. To add your own icons in the Lucide style, see custom Lucide icons.

lucide-react vs Heroicons

Both are clean outline sets. Lucide has more icons (about 1,890 vs 322 shapes in Heroicons) and one stroke style you tune with strokeWidth. Heroicons has fewer icons but four hand-tuned styles, including 20px and 16px solid versions drawn for small sizes. Pick Heroicons if your UI is built on Tailwind UI patterns; pick Lucide if you need breadth. More detail: Lucide vs Heroicons.

A reusable icon component

Pass the icon component itself, not a string name. A string lookup (icons[name]) forces every icon into the bundle.

import type { LucideIcon } from 'lucide-react';

type IconButtonProps = {
  icon: LucideIcon;
  label: string;
  onClick?: () => void;
};

export function IconButton({ icon: Icon, label, onClick }: IconButtonProps) {
  return (
    <button type="button" aria-label={label} onClick={onClick}
      className="inline-flex size-10 items-center justify-center rounded-md">
      <Icon size={20} />
    </button>
  );
}

// <IconButton icon={Trash2} label="Delete file" />

The button carries the aria-label; the icon stays hidden from screen readers. More patterns: accessible SVG icons.

Using your own SVG file in React

Two options for a single logo or illustration:

  1. As an image. Vite and most bundlers return a URL when you import an SVG: import logoUrl from './logo.svg', then <img src={logoUrl} alt="Acme" />. Simple, cached, but CSS cannot recolor it.
  2. As a component with SVGR. In Vite, add vite-plugin-svgr and import with the ?react suffix: import Logo from './logo.svg?react'. The SVG is inlined, so fill="currentColor" works.

Run the file through the SVG optimizer first to strip editor metadata. For Next.js config (webpack and Turbopack), see SVG icons in Next.js.

FAQ

What is the best icon library for React?
For most apps, lucide-react: about 1,890 icons, ISC license, tree-shakable named imports and a context provider for defaults. Choose Phosphor for multiple weights, Heroicons for Tailwind-style UIs and Tabler for the largest outline set.
Is react-icons the same as lucide-react?
No. react-icons bundles many sets, including a Lucide snapshot under react-icons/lu. lucide-react is Lucide's official package and has the current icon set. The react-icons README lists 1,215 Lucide icons; upstream Lucide has about 1,890.
How do lucide-react icons render?
As inline svg elements with a 24x24 viewBox, fill none, stroke currentColor, stroke width 2, round caps and joins, and a lucide- class. Since v1 they include aria-hidden true unless you pass an accessible label.
Why is the GitHub icon missing from lucide-react?
Lucide v1 removed all brand icons. Use Simple Icons or the brand's official SVG instead.
How do I import Heroicons in React?
npm install @heroicons/react, then import from a size and style path, for example import { BeakerIcon } from '@heroicons/react/24/outline'. Size it with CSS classes such as size-6.
Does react-icons increase bundle size?
Named imports from a subpath (react-icons/fa) are tree-shaken by modern bundlers. The install itself is large because it contains every set, but only imported icons reach the browser bundle.

Related posts

Share this post