Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@editora/icons

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@editora/icons

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

latest
Source
npmnpm
Version
0.1.7
Version published
Maintainers
1
Created
Source

@editora/icons

[!IMPORTANT] Live Website: https://editora-ecosystem.netlify.app/
Storybook: https://editora-ecosystem-storybook.netlify.app/?path=/story/ui-icons-catalog--all-icons

Framework-agnostic SVG icon library for the Editora UI ecosystem, with 500+ ready-to-use icons.

Use this package when you need:

  • 500+ generic UI, product, utility, and logo icons,
  • 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.
Icon Catalog

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:

OptionTypeDefaultNotes
variant'outline' | 'solid' | 'duotone''outline'Falls back to outline when unavailable.
sizenumber | string15Sets SVG width/height.
colorstring'currentColor'Primary color.
secondaryColorstringcolorFor duotone secondary paths.
strokeWidthnumber1.5Stroke thickness.
absoluteStrokeWidthbooleanfalseKeeps perceived stroke width stable across sizes.
strokeLinecap'butt' | 'round' | 'square''round'Applied when stroke exists.
strokeLinejoin'miter' | 'round' | 'bevel''round'Applied when stroke exists.
titlestringundefinedAdds <title>.
ariaLabelstringinferredAccessibility label for semantic icons.
decorativebooleaninferredIf true, outputs aria-hidden/presentation role.
rotatenumber0Rotation in degrees.
flip'horizontal' | 'vertical' | 'both'undefinedFlip transform.
rtlbooleanfalseMirrors icons marked rtlMirror.
classNamestringundefinedApplied on root <svg>.
stylestringundefinedInline style text on root <svg>.
attrsRecord<string, ...>undefinedExtra 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.

Keywords

editora

FAQs

Package last updated on 03 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts