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-angular

v1.0.19

Published

The Angular foundation of the Polymorph design system, which a consumer installs: the engine re-exported, a Zag adapter driven by signals, the icon gateway, the presence and control-ref primitives, the slot conventions, the toast store and the page-transi

Readme

@polymorph/angular

The Angular foundation. It re-exports @polymorph/engine whole and adds the parts that exist only in Angular: a Zag adapter driven by signals, the member's context, the slot directives, the cells a member's scope is written in, the icon gateway, the toast store, the page-transition convention and the states fixture's types. It is the counterpart of @polymorph/react and @polymorph/vue. The Angular vocabulary, @polymorph/angular-ui, is built on it, and an application that vendors Angular 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. devWarning is the foundation's own: it reads ngDevMode, because the Angular CLI does not define process.env.NODE_ENV in the browser.
  • The Zag adapter (src/zag/): useMachine, a machine whose context and state are signals; normalizeProps and mergeParts; and the Spread directive ([pmSpread]), which writes a machine's props onto an element. Zag ships no Angular binding, so src/zag/ is one.
  • The member's context: useMember, MemberContext, MEMBER_PROVIDERS, setup and the identity a member lends (lend, lentIdentity, ownerOf, provideOwner).
  • Slots and nodes: SlotTemplate (pmSlot), SlotOutlet (pmSlotOutlet), Render (pmRender), Portal (pmPortal), bindTemplate, bindSlot and NodeTemplate.
  • Cells and effects: cell, derived, measured, elementRef, elementList, Ref (pmRef), hostRef, useControlRef; mountEffect, watchEffect, watchMeasured, useDeparture and useMediaQuery.
  • The icon gateway: Glyph (svg[pmGlyph]), BrandMark (svg[pmBrandMark]) and the Icon member, which @polymorph/angular-ui re-exports.
  • The toast store, the page-transition convention (PageTransition, PageTransitions, usePageTransitionPending) and the states fixture's types and helpers (ComponentStates, StateEntry, Overrides, typeInto).
  • The presences (@polymorph/angular/motion): usePresence, useKeyedPresence and useListPresence. The subpath is for member internals, so it is not a root export.

src/icon/Icon.ts, 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

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

Each entry point is one flat ES module under dist/fesm2022/, as the Angular package format ships one. A build that links only that format's flat modules, as Analog's Vite plugin does, links these, and the Angular CLI links any. The package has no stylesheet export: the build compiles Icon's stylesheet into the Icon component's styles, so no module imports a stylesheet and plain Node loads every one.

Build

pnpm --filter @polymorph/angular build runs node scripts/package.mjs, the script the vocabulary's build runs too. It stages the shipped source, compiles each CSS Module a component imports into that component's styles, compiles with ngc in partial mode (with declarations), writes every relative import fully specified, and bundles each entry point into its flat module, every package import external. The application's Angular links the partial declarations to the Angular it runs. The script reads @polymorph/engine from its built declarations (packages/engine/dist/types), so the engine is built first; pnpm build:packages runs the builds in that order.

Dependencies and peers

| Peer | Range | | --------------- | --------- | | @angular/core | ^22.0.0 |

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

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

Tests

pnpm exec vitest run packages/angular/packaging.test.ts   # node: runs the real build
pnpm exec vitest run packages/angular/src/zag/zag.test.ts  # the adapter, in chromium

packaging.test.ts runs in the logic project. It checks that every export target exists, each entry point is one flat module and every shipped module keeps its declarations, every component is a partial declaration, Icon's rules are in its component, every relative import names a shipped file, the engine and Angular stay external and are declared, and the presences stay on ./motion. src/zag/zag.test.ts runs in the angular project and holds the adapter to a checkbox, a dialog and a menu in a browser.

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 Angular.