Frequently Asked Questions
Find answers to common questions about React Icons.Installation & Setup
What version of React do I need?
What version of React do I need?
Can I use React Icons with TypeScript?
Can I use React Icons with TypeScript?
@types package is needed:Does React Icons work with Next.js?
Does React Icons work with Next.js?
Can I use React Icons with Create React App?
Can I use React Icons with Create React App?
Does it work with Vite?
Does it work with Vite?
Bundle Size & Performance
Why is my bundle size so large?
Why is my bundle size so large?
How much do icons add to my bundle?
How much do icons add to my bundle?
- 1 icon ≈ 1-2 KB
- 10 icons ≈ 10-20 KB
- 100 icons ≈ 100-200 KB
Does React Icons support tree-shaking?
Does React Icons support tree-shaking?
"sideEffects": false, enabling aggressive tree-shaking in modern bundlers.See the Tree-Shaking guide for details.Should I use @react-icons/all-files?
Should I use @react-icons/all-files?
@react-icons/all-files package is outdated and has not been updated recently.Use the main react-icons package instead:Can I lazy load icons?
Can I lazy load icons?
Usage & Customization
How do I change icon size?
How do I change icon size?
size prop:How do I change icon color?
How do I change icon color?
color prop or CSS:Can I use CSS classes with icons?
Can I use CSS classes with icons?
className prop:How do I add hover effects?
How do I add hover effects?
Can I animate icons?
Can I animate icons?
How do I use icons in buttons?
How do I use icons in buttons?
Icon Libraries
Which icon library should I use?
Which icon library should I use?
- Font Awesome - Most comprehensive, 2,000+ icons
- Material Design - For Material UI projects, 4,000+ icons
- Heroicons - For Tailwind CSS projects, clean design
- Lucide - Modern, beautiful, 1,500+ icons
- Bootstrap Icons - For Bootstrap projects, 2,700+ icons
Can I mix icons from different libraries?
Can I mix icons from different libraries?
How do I find the right icon name?
How do I find the right icon name?
- Prefix + icon name:
FaBeer,MdHome,HiUser - Variants use suffixes:
FaRegStar(regular),HiOutlineHome(outline)
Are the icon packs kept up to date?
Are the icon packs kept up to date?
Can I request a new icon pack?
Can I request a new icon pack?
- Icon pack name and website
- License (must be open source)
- Number of icons
- Use case
Server-Side Rendering (SSR)
Does React Icons work with SSR?
Does React Icons work with SSR?
- Next.js (Pages & App Router)
- Remix
- Gatsby
- Astro with React
Do I need special configuration for Next.js App Router?
Do I need special configuration for Next.js App Router?
Accessibility
Are icons accessible?
Are icons accessible?
Should I use aria-label with icons?
Should I use aria-label with icons?
aria-label on the parent:Troubleshooting
Icons are not showing up
Icons are not showing up
- Installed the package:
npm install react-icons - Imported correctly:
import { FaBeer } from "react-icons/fa" - Used the correct icon name (case-sensitive)
TypeScript shows errors
TypeScript shows errors
- Don’t have
@types/react-iconsinstalled (conflicts with native types) - Are using a compatible TypeScript version (5.0+)
- Have correct imports
Icons appear misaligned
Icons appear misaligned