Skip to content

SimplyPrint/o7-icon

 
 

Repository files navigation

Fork of @o7/icon published for SimplyPrint as @simplyprint/icon.

This fork intentionally renders each icon as inline SVG paths instead of using o7's hidden SVG sprite plus <use href="#..."> output. The sprite approach is smaller, but it proved fragile in production modal/portal lifecycles where the referenced definition can be missing or fail to paint on first mount. Inline SVG output is slightly more verbose and more predictable.

The Vite import-rewrite plugin continues to work for both @simplyprint/icon and @o7/icon imports, so downstream code can migrate mechanically.

Work done on branch main. Published as @simplyprint/icon.

o7 Logo

@simplyprint/icon

A Svelte icon library forked from o7 Icon,

rendering icon paths inline for predictable production behavior.


Basic Usage

<script>
  import { UserPlus } from '@simplyprint/icon/lucide';
</script>

<UserPlus />

Icons render as ordinary inline SVG:

<svg class="🟃i" viewBox="0 0 24 24">
  <g class="🟃l">
    <path d="..." />
  </g>
</svg>

Recommended: Vite Plugin

If you don't use the Vite plugin, dev mode will be MUCH slower because Vite has to parse every icon when you import one.

Usage:

Add the plugin to your vite.config.ts:

import { o7Icon } from '@simplyprint/icon/vite';

export default defineConfig({
  plugins: [o7Icon()]
});

This automatically rewrites imports behind the scenes:

import { UserPlus } from '@simplyprint/icon/lucide';
// ↓
import UserPlus from '@simplyprint/icon/lucide/UserPlus';

Included Icon Packs:

  • Lucide (@simplyprint/icon/lucide)
  • Heroicons (@simplyprint/icon/heroicons, @simplyprint/icon/heroicons/solid)
  • Material Design (@simplyprint/icon/material, @simplyprint/icon/material/solid)
  • Remix Icon (@simplyprint/icon/remix, @simplyprint/icon/remix/solid)

Changelog

(icons are automatically updated daily as the source repos are updated)

0.4.0

  • Update to Vite 8

0.3.5

  • Fix regression that broke previews on hover

0.3.0

  • Fix heroicons/outline
  • Add Vite plugin

0.2.0

  • Slightly shrink install size
  • Fix icons not working when unmounted and remounted

0.0.13

  • Add RemixIcon

0.0.6

  • Add material icons

About

The most efficient Svelte icon library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 78.2%
  • JavaScript 9.6%
  • Svelte 7.6%
  • CSS 2.4%
  • HTML 2.2%