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

@metamorph-labs/polymorph-svelte

v1.0.19

Published

The Svelte foundation of the Polymorph design system, which a consumer installs: the engine re-exported, the icon gateway, the motion presence, the control ref, the toast store and the page-transition convention. Svelte members import this and nothing dee

Readme

@polymorph/svelte

The Svelte foundation. It re-exports @polymorph/engine whole and adds the parts that exist only in Svelte 5: the icon gateway, the slot conventions, the machine-prop spelling, the toast store, the page-transition convention and the states fixture's types. It is the counterpart of @polymorph/react and @polymorph/vue. The Svelte vocabulary, @polymorph/svelte-ui, is built on it, and an application that vendors Svelte members installs it. A member imports this package and nothing deeper.

It contains:

  • The engine, whole. The root is export * from '@polymorph/engine', plus the engine's charts, markdown and qr subpaths, so a member reaches every framework-free helper here.
  • The icon gateway: Glyph, which draws a role's glyph from src/icon/glyphs.ts; BrandMark, a third-party mark from the engine's BRAND_DRAWINGS; and the Icon member, which @polymorph/svelte-ui re-exports.
  • A machine's props in Svelte: normalizeProps, attributes, mergeParts, chainHandlers and styleText, over @zag-js/types.
  • The slot conventions: joinSlot, SlotScope, SlotOutlet and SlotText, through which a member reads what a caller put in a snippet and hands it props, and Render, bindSnippet, isBound and Portal. Under Vite, a server render reads a slot through svelte/server (src/conventions/server.ts).
  • Effects and refs: watchEffect, afterRender, refList, useDeparture, useControlRef, useMediaQuery and MEDIA_QUERIES.
  • The toast store (toast, useToasts, getToasts, subscribeToasts, removeToast), the page-transition convention (PageTransition, PageTransitions, usePageTransitionPending) and the states fixture's types and holder (ComponentStates, StateEntry, Overrides, Held).
  • The presences (@polymorph/svelte/motion): usePresence, useKeyedPresence and useListPresence, with the engine's motion environment, patterns and values re-exported by name. The subpath is for member internals, so it is not a root export.

src/icon/Icon.svelte, src/icon/glyphs.ts and src/icon/icon.module.css are generated by pnpm shells; never edit them by hand. The rest of src/ is written by hand. docs/shells.md describes every export.

Entry points

Both entries publish under the svelte export condition, with types and default beside it:

| Import | In-repo (exports): types, svelte, default | Built (publishConfig.exports) | | -------------------------- | ------------------------------------------------- | ----------------------------------------------------------------- | | @polymorph/svelte | src/index.ts | types: dist/index.d.ts; svelte, default: dist/index.js | | @polymorph/svelte/motion | src/motion/index.ts | types: dist/motion/index.d.ts; svelte, default: dist/motion/index.js |

Build

pnpm --filter @polymorph/svelte build runs node scripts/package.mjs ., which the vocabulary's build runs too. A Svelte library ships its components as source, because the consumer's Svelte compiles them for the browser and for a server render. So dist/ holds every component as it is, each TypeScript module as JavaScript (a rune module as *.svelte.js), every stylesheet as it is, every relative import fully specified, and the declarations from svelte2tsx. Icon's stylesheet ships beside Icon.svelte, and the consumer's bundler compiles it. There is no node copy: Node cannot load a component.

Dependencies and peers

| Peer | Range | | -------- | --------- | | svelte | ^5.46.4 |

Dependencies: @polymorph/engine (workspace:* here, published as an npm: alias of @metamorph-labs/polymorph-engine) and @zag-js/types ^1.46.0.

The package is published as @metamorph-labs/polymorph-svelte and installed as @polymorph/svelte through an npm alias ("@polymorph/svelte": "npm:@metamorph-labs/polymorph-svelte@^1.0.0"). docs/consuming.md has the application's side.

Tests

pnpm exec vitest run packages/svelte/packaging.test.ts   # node: runs the real build

packaging.test.ts runs in the logic project. It builds dist/ and checks that every export target exists, every shipped file mirrors a source file, every relative import names a shipped file, every component and rune module compiles for the browser and for a server render, the presences stay on ./motion, every imported package is declared, and the declarations typecheck under a strict consumer. The presences and the slot conventions have browser tests in the vocabulary (packages/svelte-ui/src/conventions/presence.test.ts, packages/svelte-ui/src/conventions/slotted.test.ts, the svelte project).

See docs/shells.md for how the members built on this package are generated, and docs/frameworks.md for how a React prop reads in Svelte.