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

@hozo/primitives

v0.3.0

Published

Canonical universal UI primitives for Hozo applications.

Readme

@hozo/primitives

Canonical universal UI components for Hozo: View, Text, Pressable, Button, Link, Image, TextInput, ScrollView, FlatList and RefreshControl -- the components whose meaning is the same on every platform.

Applications usually import these from @hozo/core, which re-exports this package. The compiler lowers them to semantic DOM and CSS on the Web and to React Native components and a StyleSheet on device. Where it cannot -- Hozo is not in the build, or a usage it does not model -- they still render: the browser entry supplies the DOM behavior, and the Native entry is React Native's own implementation.

import { FlatList, Pressable, Text } from '@hozo/core'

export function Inbox({ messages, onOpen }) {
  return (
    <FlatList
      data={messages}
      keyExtractor={(message) => message.id}
      renderItem={({ item }) => (
        <Pressable className="p-4" accessibilityRole="button" onPress={() => onOpen(item)}>
          <Text className="font-semibold">{item.subject}</Text>
        </Pressable>
      )}
    />
  )
}

The browser FlatList windows its rows itself, so compiled and uncompiled paths behave the same, and it reports the list's full length to assistive technology with aria-setsize/aria-posinset.

On Android each cell still reports where it sits, but the list no longer reports how long it is. Android's collection info is set through an undocumented prop whose reader crashes the app on a child that does not carry the matching per-item tag — which VirtualizedList's own windowing spacers do not. See #512; it comes back when React Native stops casting that tag with as instead of as?.

Responsive images

Image does what #155 asked for with what each platform already has, rather than with a second image component:

| | Web | React Native | |---|---|---| | A box before the image loads | aspect-video, aspect-[4/3]: CSS aspect-ratio | the same classes: aspectRatio | | Several resolutions | srcSet and sizes, passed to <img> | srcSet, which React Native reads itself, by density only (1x, 2x, 3x) | | A picture to show instead | defaultSource, shown if the image fails | defaultSource, shown while it loads on iOS | | loading="lazy" | the browser's | ignored |

Width descriptors (800w) are skipped on device with a runtime warning, and sizes is not read there, so the compiler warns about a srcSet written with them.

Not provided:

  • BlurHash: decoding one needs a library, which is a dependency for the application to choose (expo-image on Native).
  • A <Picture> with format negotiation: that is the server's or the CDN's job, done with Accept.

What each primitive compiles to on both platforms is generated into docs/primitives.md.

Compiler runtime

@hozo/primitives/generated/* is the generated-code ABI, not an authoring API: one module per leaf (flat-list, view, grid, ...), because Metro does not tree-shake and a compiled screen carries whatever module it imports. Compiled output reaches these through @hozo/core/generated/*, which the application already depends on. On Native the leaves include the component boundaries needed to emulate browser layout and presentation features that React Native does not provide: grid tracks, container queries, child spacing, relative text sizes, transitions, and configured backdrop blur. Those have no Web implementation to speak of, because they lower to CSS there.


Part of Hozo, a Rust-powered universal UI compiler and accessibility-first layer for React Native. Most applications install @hozo/core and one build integration; see Getting started. Source and issues: github.com/iray-tno/hozo.