Core
The icon catalog, SVG sprite, and font files as one dependency-free package.
@dev.icons/core holds the catalog of icon files with their font codepoints, icons.json, a color SVG sprite, and the icon font files. It has no dependencies.
The framework packages don’t need it. Install it when you need the list of icon files, the sprite, or the font files for custom tooling or a plugin.
Install
npm install @dev.icons/core
Exports
| Export | Type | Description |
|---|---|---|
ICONS | readonly IconRecord[] | Every icon file, sorted by codepoint |
getIcon | (name: string) => IconRecord | undefined | O(1) lookup by file name |
IconRecord | type | { name, codepoint, unicode, isVariant } |
interface IconRecord {
/** File name without `.svg`, e.g. "adonisjs" or "adonisjs-icon". */
name: string;
/** Private Use Area codepoint used by the icon font. */
codepoint: number;
/** String.fromCodePoint(codepoint). */
unicode: string;
/** True when name ends in "-icon" (glyph-only mark). */
isVariant: boolean;
}
Usage
import { ICONS, getIcon } from "@dev.icons/core";
getIcon("nextjs-icon");
// { name: "nextjs-icon", codepoint: ..., unicode: "...", isVariant: true }
const fullLogos = ICONS.filter((icon) => !icon.isVariant).map((icon) => icon.name);
Files
| Subpath export | File |
|---|---|
@dev.icons/core/icons.json | dist/icons.json (same data as ICONS) |
@dev.icons/core/sprite | dist/sprite/sprite-symbol.svg (color sprite, <symbol id="{file}">) |
@dev.icons/core/font/css | dist/font/devicons.css |
@dev.icons/core/font/woff2 | dist/font/devicons.woff2 |
@dev.icons/core/font/ttf | dist/font/devicons.ttf |
When to use core
- You need the full list of icon files for search, filtering, or code generation
- You want to self-host the SVG sprite
- You’re building a custom icon component for a framework we don’t ship yet
- You’re writing a bundler plugin, Figma plugin, or CLI tool