open-icon
v1.1.9
Published
Primary Open Icon package with generated catalog helpers and icon access APIs.
Maintainers
Readme
open-icon
open-icon is the main package for the Open Icon catalog.
It gives you:
- typed icon names and categories
- a root
Iconslookup for app code loadIcon()fromopen-icon/runtimefor per-icon lazy loadinggetIcon()fromopen-iconoropen-icon/staticfor synchronous SVG access- tree-shakable named exports from
open-icon/icons
Install
npm install open-iconChoose the entrypoint
import { Icons, getIcon, getOpenIconImportPath } from 'open-icon';
import { loadIcon } from 'open-icon/runtime';
const iconName = Icons.UI_ADD_M;
const iconSvg = getIcon(iconName);
const lazyIconSvg = await loadIcon(iconName);
const importPath = getOpenIconImportPath('wayfinding/check-in');open-iconandopen-icon/staticinclude synchronousgetIcon()access. Use them for static rendering, server rendering, or tooling.open-icon/runtimekeeps icon markup behind per-icon loaders. Use it when wrappers or apps should avoid pulling the full icon map into the default client path.
Tree-shakable icons
import { IconAddM, IconUiKey } from 'open-icon/icons';
console.log(IconAddM);
console.log(IconUiKey);Package split
open-iconis the main catalog/helper packageopen-icon/runtimeis the lazy runtime entrypointopen-icon/staticis the synchronous full-catalog entrypointopen-icon-svgships the raw SVG filesopen-icon-transformapplies the transform pipeline in scripts and toolingvite-plugin-open-iconapplies the transform pipeline during Vite imports
