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.
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.
| Package | Icon set | Icons | License | Default size | Import |
|---|---|---|---|---|---|
lucide-react 1.x | Lucide | about 1,890 | ISC | 24px | import { Search } from 'lucide-react' |
@heroicons/react 2.x | Heroicons | 1,288 (4 styles) | MIT | set with CSS | import { BeakerIcon } from '@heroicons/react/24/outline' |
@phosphor-icons/react 2.x | Phosphor | 9,072 (1,512 x 6 weights) | MIT | 1em | import { HeartIcon } from '@phosphor-icons/react' |
@tabler/icons-react 3.x | Tabler | about 6,200 | MIT | 24px | import { IconArrowLeft } from '@tabler/icons-react' |
react-icons 5.x | many sets | depends on set | MIT (each set keeps its own license) | 1em | import { FaBeer } from 'react-icons/fa' |
@iconify/react 6.x | any Iconify set | 200+ sets | MIT | 1em | <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:
| Set | Bundled in react-icons (README) | Upstream today |
|---|---|---|
| Lucide | 1,215 icons | about 1,890 |
| Heroicons 2 | v2.1.3 | v2.2.0 |
| Tabler | 5,237 icons (v3.2.0) | about 6,200 |
| Phosphor | 9,072 icons | 9,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,strokeWidthandabsoluteStrokeWidth, plus any SVG attribute (className,onClick,aria-label). - Names: every icon is exported three ways, for example
Search,SearchIconandLucideSearch. Pick one style per codebase. - Accessibility: since v1, icons get
aria-hidden="true"by default, per the Lucide v1 release notes. Passaria-labelortitlewhen an icon carries meaning on its own. - Global defaults: v1 added
LucideProviderfor 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:
- 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. - As a component with SVGR. In Vite, add vite-plugin-svgr and import with the
?reactsuffix:import Logo from './logo.svg?react'. The SVG is inlined, sofill="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?
Is react-icons the same as lucide-react?
How do lucide-react icons render?
Why is the GitHub icon missing from lucide-react?
How do I import Heroicons in React?
Does react-icons increase bundle size?
Related posts