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

svelte-fluent-icon

v0.0.1

Published

A tiny Svelte 5 component library that exposes Microsoft Fluent System Icons as Svelte components. Icons are sourced from `@iconify-json/fluent` and compiled into tree-shakeable modules.

Readme

svelte-fluent-icon

A tiny Svelte 5 component library that exposes Microsoft Fluent System Icons as Svelte components. Icons are sourced from @iconify-json/fluent and compiled into tree-shakeable modules.

  • Framework: Svelte 5 (peer dependency)
  • Package name: svelte-fluent-icon
  • Generated from: @iconify-json/fluent using a small generator script (generate-icon.ts)

Install

# with pnpm
pnpm add svelte-fluent-icon

# with npm
yarn add svelte-fluent-icon

# with yarn
npm i svelte-fluent-icon

Usage

There are two ways to import icons:

  1. Import by size and style (recommended for clear intent and smaller bundles)
<script>
  // 20px, filled variant
  import { AccessTimeIcon } from 'svelte-fluent-icon/icon/20/filled';
</script>

<AccessTimeIcon width={20} height={20} aria-label="Access time" />
  1. Import from the package root using a suffixed name
<script>
  // Name is suffixed with size+style
  import { AccessTime20FilledIcon } from 'svelte-fluent-icon';
</script>

<AccessTime20FilledIcon class="text-gray-700" aria-hidden />

Notes

  • Components accept standard SVG attributes (width, height, class, style, role, aria-*).
  • Svelte 5 render hooks are available: a pre render function and the default children render function are supported internally by the generator, allowing advanced composition if needed.

Available sizes and styles

Icons are generated in these sizes and styles (matching Fluent icons availability):

  • Sizes: 10, 12, 16, 20, 24, 28, 32, 48
  • Styles: regular, filled, light (light only for some sizes)

Import paths follow:

  • svelte-fluent-icon/icon/<size>/<style> for per-folder named exports (e.g. AccessTimeIcon)
  • Root exports expose suffixed names (e.g. AccessTime20FilledIcon)

How it works (generation)

The generator (generate-icon.ts) reads Fluent icon metadata and creates Svelte components under src/lib/icon/<size>/<style>. For each icon it:

  • Renders SVG via @iconify/utils (iconToSVG, iconToHTML, replaceIDs)
  • Emits <Name>.svelte with Svelte 5 render hooks (pre, children) and forwards all remaining SVG props
  • Writes index.ts files so you can import either by folder or via the package root

You can regenerate icons locally with:

pnpm run generate

This will clean previously generated folders and build fresh components.

Scripts

These are the most relevant commands from package.json:

  • pnpm run generate — regenerate icons from @iconify-json/fluent
  • pnpm run prepack — clean, generate, sync, and package the library
  • pnpm run build — app build then prepack the library
  • pnpm run check — typecheck via svelte-check

TypeScript

Type definitions for the library are emitted to dist. The package exports map exposes both Svelte and types for root and per-folder entry points.

License

MIT — see the LICENSE file.

Acknowledgements

  • Icons: @iconify-json/fluent
  • Utilities: @iconify/utils
  • Packaging: SvelteKit + @sveltejs/package