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

@pyreon/primitives

v0.51.0

Published

Canonical multi-platform UI primitives — semantic vocabulary that compiles to DOM (web), SwiftUI (iOS), and Compose (Android). The Pyreon Multi-Target story.

Readme

@pyreon/primitives

Canonical multi-platform UI primitives — semantic vocabulary that compiles to DOM (web), SwiftUI (iOS), and Compose (Android). The Pyreon Multi-Target story.

Status: experimental. Phase A of a 5-phase rollout. 6 of 16 primitives have web implementations; the rest ship in follow-ups.

What this is

@pyreon/primitives is the canonical UI vocabulary for Pyreon apps that target multiple platforms (web + iOS + Android). Same source. Three idiomatic outputs.

import { Stack, Inline, Text, Button, Field } from '@pyreon/primitives'

function TodoApp() {
  return (
    <Stack gap="md" padding="md">
      <Text size="lg" weight="bold">Todos</Text>
      <Field value={draft} onChangeText={(t) => draft.set(t)} placeholder="Add..." />
      <Inline gap="sm" align="center">
        <Text>Total: {todos().length}</Text>
        <Button onPress={addTodo}>Add</Button>
      </Inline>
    </Stack>
  )
}

On the web target this compiles via @pyreon/runtime-dom to DOM (the implementations in src/web/). On iOS + Android via PMTC, the compiler intercepts JSX at compile time and emits SwiftUI / Compose primitives — the imports here are type-anchor only on native targets.

Phase A scope (this package)

6 primitives with real web implementations:

| Primitive | DOM shape | Notes | |-----------|-----------|-------| | <Stack> | <div style="display:flex"> | Default direction="column" | | <Inline> | <div style="display:flex;flex-direction:row"> | Sugar for <Stack direction="row"> | | <Text> | <span> | Tokenized color / size / weight / truncate | | <Button> | <button> | 4 variants (primary/secondary/ghost/danger) | | <Press> | <div role="button" tabindex="0"> | ARIA-button keyboard contract + long-press polyfill | | <Field> | <input> | kind prop selects type (text/email/password/etc.) |

10 more primitives have type definitions but no web runtime yet (<Layer>, <Scroll>, <Spacer>, <Heading>, <Image>, <Icon>, <Link>, <Toggle>, <Modal>). They ship in follow-up PRs as real apps demand each.

Design principles

  1. Semantic names, not platform names. <Stack> not <View> / <VStack> / <div>. Name describes intent.
  2. One canonical event name per concept. onPress everywhere (not onClick on web + action: on iOS).
  3. Tokens-first styling. padding={4} / gap="md" resolve via theme. No raw pixels.
  4. Pyreon idioms preserved. Existing <For> / <Show> / <Match> control flow stays.
  5. Minimal first; expand from real-world usage. 16 primitives; more when demanded.

Per-platform import resolution

import { Stack } from '@pyreon/primitives':

  • Web: real package, real ComponentFn, renders DOM.
  • iOS / Android (via PMTC): compiler intercepts the JSX call site BEFORE the runtime is invoked. The import is type-anchor only — Stack is never actually called on native targets.

Same source. Three idiomatic outputs.

Style system (v1 scope)

Tokens-first. No responsive props in v1. No animation primitives in v1. Apps that need rich responsive web layouts use @pyreon/elements directly.

| Prop | Type | Example | |------|------|---------| | padding / margin / gap | number (theme.space index) OR "sm"\|"md"\|"lg" | padding={4} → 16px | | color | "text"\|"surface"\|"primary"\|... | color="primary" → blue-600 | | background | theme key | background="surface" → white | | align | "start"\|"center"\|"end"\|"stretch" | flex alignItems | | justify | "start"\|"center"\|"end"\|"between"\|"around"\|"evenly" | flex justifyContent | | radius | "none"\|"sm"\|"md"\|"lg"\|"full" | border-radius |

Tests

cd packages/core/primitives
bun run test            # happy-dom unit tests (token resolution)
bun run test:browser    # real-Chromium browser smoke (6 primitives end-to-end)

Related

License

MIT — see LICENSE at repo root.