Nitro Icons
A clean, scalable icon library with 23+ icons. Auto-generated React components with full TypeScript support, tree-shaking, and inline customization.
Introduction
Nitro Icons is a developer-first icon system built for React and Next.js applications. Every icon is an individual React component — import only what you need, and your bundler tree-shakes the rest.
Installation
Install the React package from npm. The package has React 18+ as a peer dependency.
npm install nitro-icons-reactOr with other package managers:
yarn add nitro-icons-reactpnpm add nitro-icons-reactBasic Usage
Import any icon by its PascalCase name and use it as a React component.
import { Home, User, ArrowRight } from "nitro-icons-react";
export default function App() {
return (
<div>
<Home />
<User size={32} />
<ArrowRight strokeWidth={2.5} />
</div>
);
}Icons render as inline SVGs. They inherit the current text color by default and accept all standard SVG attributes.
Props
Every icon component accepts these props, plus all native SVG element attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
| size | number | 24 | Width and height in pixels |
| strokeWidth | number | 2 | SVG stroke width |
| className | string | — | CSS class for styling |
| ...props | SVGProps | — | All standard SVG attributes |
Examples
// Custom size
<Home size={48} />
// Custom stroke width
<User strokeWidth={1.5} />
// Custom color via className (Tailwind)
<ArrowRight className="text-pink-500" />
// Custom color via inline style
<Home style={{ color: "#ff00dc" }} />
// Combining props
<Download size={20} strokeWidth={2.5} className="text-emerald-400" />Styling
Icons use currentColor for their stroke, so they inherit the text color from their parent element.
With Tailwind CSS
// Color
<Home className="text-pink-500" />
// Size via Tailwind (override size prop)
<Home className="w-8 h-8" />
// Hover effects
<Home className="text-gray-400 hover:text-white transition-colors" />
// Responsive
<Home className="w-5 h-5 md:w-6 md:h-6" />With inline styles
<Home style={{ color: "#ff00dc", width: 32, height: 32 }} />With CSS modules
// styles.module.css
.icon {
color: #ff00dc;
width: 24px;
height: 24px;
transition: color 0.2s;
}
.icon:hover {
color: #ff40e5;
}import styles from "./styles.module.css";
import { Home } from "nitro-icons-react";
<Home className={styles.icon} />Categories
Icons are organized into the following categories. Browse them all on the icons page.
Contributing
Nitro Icons is open source. To add a new icon:
- Add your SVG file to
packages/core/icons/ - Add metadata to
packages/core/metadata/icons.json - Run the generator:
pnpm build:icons # generates React components
pnpm build # builds the packageSVG guidelines: use a 24x24 viewBox, stroke="currentColor", no hardcoded widths/heights, and rounded joins for consistency.
Project structure
nitro-icons/
├── packages/
│ ├── core/ # Raw SVGs + metadata
│ │ ├── icons/ # .svg files
│ │ └── metadata/ # icons.json
│ ├── react/ # Auto-generated React components
│ └── utils/ # Build utilities
├── apps/
│ └── website/ # This documentation site
└── scripts/
└── generate-icons.tsReady to use?
Browse all 23+ icons and copy code instantly.