npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@editora/icons

v0.1.5

Published

Framework-agnostic SVG icon library for the Editora UI ecosystem with outline, solid, and duotone variants

Readme

@editora/icons

[!IMPORTANT] Live Website: https://editora-ecosystem.netlify.app/
Storybook: https://editora-ecosystem-storybook.netlify.app/

Framework-agnostic SVG icon library for the Editora UI ecosystem.

Use this package when you need:

  • raw icon definitions and registry APIs,
  • SVG string rendering in any framework/runtime,
  • icon aliases and runtime extension,
  • bridge support to register icons into @editora/ui-core.

Installation

npm install @editora/icons

Quick Start

import { renderIconSvg, listIcons } from '@editora/icons';

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

console.log(svg);
console.log(listIcons().slice(0, 10));

Package Exports

Definitions + registry

  • iconDefinitions
  • iconNameList
  • getIcon(name)
  • hasIcon(name)
  • listIcons()
  • listIconAliases()
  • registerIcon(definition)
  • registerIcons(definitions)
  • resolveIcon(name, variant?)

Rendering

  • renderIconSvg(name, options?)
  • iconToDataUri(name, options?)

Integration helper

  • registerWithEditoraUI(registerFn)

Types

  • IconDefinition
  • IconGlyph
  • IconNode
  • IconRenderOptions
  • IconVariant
  • ResolvedIcon
  • IconTag
  • IconAttrValue

Core Concepts

1) Names and normalization

Icon names are normalized internally:

  • lowercase
  • spaces/underscores converted to -

So "Chart Line", "chart_line", and "chart-line" resolve to the same key pattern.

2) Variants

Supported variants:

  • outline (default fallback)
  • solid
  • duotone

If a requested variant is missing, the renderer automatically falls back to outline.

3) Aliases

Definitions can include aliases. getIcon and resolveIcon check aliases automatically.

API Usage

Registry lookup

import { hasIcon, getIcon, resolveIcon, listIconAliases } from '@editora/icons';

if (hasIcon('navigation')) {
  const def = getIcon('navigation');
  const resolved = resolveIcon('navigation', 'duotone');
  console.log(def?.name, resolved?.variant);
}

console.log(listIconAliases());

Render SVG string

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

const svg = renderIconSvg('chart-line', {
  variant: 'duotone',
  size: 20,
  color: 'var(--ui-fg)',
  secondaryColor: 'var(--ui-fg-muted)',
  strokeWidth: 1.5,
  strokeLinecap: 'round',
  strokeLinejoin: 'round',
  title: 'Revenue trend'
});

Render as Data URI

import { iconToDataUri } from '@editora/icons';

const uri = iconToDataUri('check-circle', {
  size: 14,
  color: '#16a34a',
  decorative: true
});

// Example: CSS background-image
// background-image: url("${uri}");

IconRenderOptions

Common options for renderIconSvg and iconToDataUri:

| Option | Type | Default | Notes | |---|---|---|---| | variant | 'outline' \| 'solid' \| 'duotone' | 'outline' | Falls back to outline when unavailable. | | size | number \| string | 15 | Sets SVG width/height. | | color | string | 'currentColor' | Primary color. | | secondaryColor | string | color | For duotone secondary paths. | | strokeWidth | number | 1.5 | Stroke thickness. | | absoluteStrokeWidth | boolean | false | Keeps perceived stroke width stable across sizes. | | strokeLinecap | 'butt' \| 'round' \| 'square' | 'round' | Applied when stroke exists. | | strokeLinejoin | 'miter' \| 'round' \| 'bevel' | 'round' | Applied when stroke exists. | | title | string | undefined | Adds <title>. | | ariaLabel | string | inferred | Accessibility label for semantic icons. | | decorative | boolean | inferred | If true, outputs aria-hidden/presentation role. | | rotate | number | 0 | Rotation in degrees. | | flip | 'horizontal' \| 'vertical' \| 'both' | undefined | Flip transform. | | rtl | boolean | false | Mirrors icons marked rtlMirror. | | className | string | undefined | Applied on root <svg>. | | style | string | undefined | Inline style text on root <svg>. | | attrs | Record<string, ...> | undefined | Extra root attributes (data-*, etc.). |

Register Custom Icons

You can extend the registry at runtime.

import { registerIcon, renderIconSvg, type IconDefinition } from '@editora/icons';

const CustomBillingIcon: IconDefinition = {
  name: 'billing-custom',
  aliases: ['billing-custom-outline'],
  tags: ['finance', 'invoice'],
  categories: ['business'],
  viewBox: '0 0 15 15',
  variants: {
    outline: {
      nodes: [
        { tag: 'rect', attrs: { x: 2, y: 1.5, width: 11, height: 12, rx: 2, fill: 'none', stroke: 'currentColor' } },
        { tag: 'line', attrs: { x1: 4, y1: 5, x2: 11, y2: 5, stroke: 'currentColor' } },
        { tag: 'line', attrs: { x1: 4, y1: 8, x2: 9.5, y2: 8, stroke: 'currentColor' } }
      ]
    }
  }
};

registerIcon(CustomBillingIcon);

console.log(renderIconSvg('billing-custom'));

Register many icons:

import { registerIcons } from '@editora/icons';

registerIcons([/* IconDefinition[] */]);

Integrations

With @editora/react-icons

@editora/react-icons consumes this package for React components and typed name APIs.

With @editora/ui-core

Use the built-in bridge to register all available icons into a UI core icon registry.

import { registerWithEditoraUI } from '@editora/icons';

// registerFn(name, svg) should add icon markup into your UI icon store.
registerWithEditoraUI((name, svg) => {
  console.log('registered', name, svg.length);
});

Accessibility Notes

  • Decorative icons should use decorative: true (or omit title/ariaLabel so it is inferred).
  • Semantic icons should provide title or ariaLabel.

Performance Notes

  • @editora/icons is sideEffects: false for tree-shaking.
  • Prefer reusing resolved icon names in app code instead of repeated normalization in hot loops.
  • For large CSS/icon sprites, iconToDataUri can be cached by (name, variant, size, color) keys.

Development

cd packages/icons
npm run build

Troubleshooting

  • Empty SVG returned:
    • Icon name is missing or misspelled.
    • Requested variant is unavailable and definition has no usable outline.
  • Alias not resolving:
    • Verify alias is registered in the icon definition.
  • Unexpected stroke/fill:
    • Check custom node attrs and variant nodes for fill/stroke overrides.