@devigner-ui/icons: every icon as a React component that renders its own
<svg>. React 18 or newer.
npm install @devigner-ui/iconsNo runtime dependencies; react is a peer dependency. It works with Next.js
(App Router included), Remix, Vite, Astro and any other React setup.
Import each icon from its own subpath. That loads only that icon, in dev servers and tests too:
import { IconShoppingCart } from "@devigner-ui/icons/ShoppingCart";
import IconShoppingCart from "@devigner-ui/icons/ShoppingCart"; // the same componentNamed imports from the root work as well, and production bundlers drop the icons you do not use:
import { IconShoppingCart, IconUser } from "@devigner-ui/icons";The root re-exports every icon, so tools that do not tree-shake (some test
runners, a dev server's first load) read all of them. Use subpaths when that
cost shows. Subpath types need TypeScript's moduleResolution set to
"bundler" or "node16".
If an app uses one style throughout, import from that style's entry. Each icon then ships one drawing rather than all five, under a third of the bytes:
import { IconShoppingCart } from "@devigner-ui/icons/bold";
import IconShoppingCart from "@devigner-ui/icons/bold/ShoppingCart"; // one iconThe entries are outline, twotone, bold, bulk and broken. A
component from one of them always draws that style and ignores variant;
every other prop works the same. Entries can be mixed in one app.
| Prop | Type | Default | What it does |
|---|---|---|---|
variant |
"Outline" | "TwoTone" | "Bold" | "Bulk" | "Broken" |
"Outline" |
Which drawing to render |
strokeWidth |
string | number |
"1.5" |
Line weight of Outline, TwoTone and Broken |
className |
string |
Size and colour |
Everything an <svg> takes passes through (onClick, style, id,
data-*, the aria attributes), and the ref reaches the <svg>, so an icon
works as a Radix, Headless UI or tooltip trigger.
<IconShoppingCart className="size-6" />
<IconShoppingCart variant="Bulk" className="size-6 text-violet-600" />
<IconShoppingCart strokeWidth={2} className="size-6" />There is no size or color prop: icons paint with currentColor, so size
and colour are CSS. See Usage for the styles and
accessibility.
The package carries a "use client" banner, so a server component can render
an icon without you marking your own file.
import "@devigner-ui/icons/styles.css";It adds one .icon class driven by three variables, for apps that size icons
with CSS rather than utility classes:
:root {
--icon-size: 24px;
--icon-stroke-width: 2;
--icon-color: currentColor;
}CSS stroke-width wins over the attribute the component writes, so
--icon-stroke-width overrides the strokeWidth prop.
| Import | What it is |
|---|---|
@devigner-ui/icons/metadata.json |
Every icon's name, category, keywords, styles and former names |
@devigner-ui/icons/embeddings.json |
One search vector per icon; see AI search |
@devigner-ui/icons/renames.json |
Every rename, for tooling; see All renames |
The package also ships the CLI: search, copy and migrate from a terminal. Types are on the TypeScript page.