React
Custom SVG icons as React components
Every Inkicon pack includes a react folder: one component per icon, TypeScript types, and nothing to install beyond React itself.
Use them
import { HomeIcon, SearchIcon } from './icons/react/icons.js';
export function Toolbar() {
return (
<nav>
<a href="/"><HomeIcon size={20} /> Home</a>
<button aria-label="Search"><SearchIcon /></button>
</nav>
);
}
- Size:
sizesets width and height (default 24). Any other SVG prop passes through, includingclassNameandstyle. - Colour: icons draw in
currentColor, so they follow your text colour and dark mode. - Accessibility: icons are hidden from screen readers by default. Pass
titlewhen an icon stands alone and means something. - Refs and types: components forward refs, and
icons.d.tstypes every one. - A lookup table:
iconsmaps names to components, for menus built from data:const Icon = icons['arrow-left'].
The module uses createElement rather than JSX, so it works in Vite, Next.js, Remix and Create React App with no extra build setup, and with Preact through preact/compat.
Why not an icon package?
Packages like lucide-react are great when their look suits you. A custom set gives your product its own look and any icon you need, and you keep the same convenient component API. When a free set is enough.