Skip to main content
Version: Next

@editora/icons

Framework-agnostic icon registry + rendering package.

Installation

npm i @editora/icons

API Surface

SurfaceTypeNotes
iconDefinitions, iconNameListData exportsBuilt-in icon metadata catalog
getIcon, hasIcon, listIcons, listIconAliases, resolveIconRegistry functionsQuery and resolve icons/aliases
registerIcon, registerIconsRegistry functionsRegister custom icon definitions
renderIconSvg, iconToDataUriRender functionsSVG string and data-URI generation
registerWithEditoraUI(registerFn)Integration helperPush icon set into UI-core registries
IconAttrValue, IconDefinition, IconGlyph, IconNode, IconRenderOptions, IconTag, IconVariant, ResolvedIconType exportsIcon typing for authoring and rendering

Usage Example

import { renderIconSvg } from "@editora/icons";

const svg = renderIconSvg("check", {
variant: "outline",
size: 16,
color: "currentColor",
strokeWidth: 1.5,
});

Best Practices

  • Use currentColor for theme-aware icon rendering.
  • Register custom icons once during app bootstrap.
  • Keep icon names stable across versions.

Accessibility

Ensure icon-only controls include text alternatives via button labels or aria labels.

Performance Notes

Prefer static imports and avoid repeated runtime registration on frequent renders.