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

@domphy/virtual

v0.16.0

Published

Domphy Virtual - headless list/grid virtualization, a 1-1 port of @tanstack/virtual-core

Downloads

1,624

Readme

@domphy/virtual

Headless list, grid, and window virtualization for Domphy apps: render only the rows/columns in view, with dynamic measurement, sticky ranges, and smooth scroll-to.

This package is a 1-1 port of @tanstack/virtual-core v3.17.0 (MIT, © Tanner Linsley and the TanStack team). The src/ is kept byte-identical to upstream, so the entire TanStack Virtual reference applies as-is and future versions can be diffed and merged directly. The only addition is the Domphy adapter in src/domphy/.

Like the rest of Domphy, the core is framework-agnostic with zero dependencies.

Install

npm install @domphy/virtual @domphy/core

@domphy/core is a peer dependency of the adapter only; the main entry is dependency-free.

Quick Example

import { createVirtualizer } from "@domphy/virtual/domphy"
import type { DomphyElement } from "@domphy/core"

const rows = Array.from({ length: 10000 }, (_, i) => `Row ${i}`)

const list = createVirtualizer<HTMLDivElement, HTMLDivElement>({
  count: rows.length,
  estimateSize: () => 32,
  overscan: 8,
})

const App: DomphyElement<"div"> = {
  // scroll container
  div: [
    {
      // total-size spacer; virtual items are absolutely positioned inside
      div: (l) =>
        list.getVirtualItems(l).map((item) => ({
          div: rows[item.index],
          style: {
            position: "absolute",
            top: "0",
            left: "0",
            width: "100%",
            height: `${item.size}px`,
            transform: `translateY(${item.start}px)`,
          },
          _key: item.key,
          _onMount: (node) => list.measureElement(node.domElement),
        })),
      style: {
        position: "relative",
        height: (l) => `${list.getTotalSize(l)}px`,
        width: "100%",
      },
    },
  ],
  style: { height: "400px", overflow: "auto" },
  _onMount: (node) => list.setScrollElement(node.domElement as HTMLDivElement),
  _onRemove: () => list.destroy(),
}

Adapter API

createVirtualizer(options) returns a handle:

| Member | Description | | --- | --- | | getVirtualItems(l) | Reactive list of visible VirtualItems — read with the listener inside the items function. | | getTotalSize(l) | Reactive total scroll size, for the spacer's height/width. | | setScrollElement(el) | Wire the scroll container DOM node; call from its _onMount. | | measureElement(el) | Dynamic measurement ref; call from each item's _onMount. | | scrollToIndex(index, opts?) / scrollToOffset(offset, opts?) | Imperative scrolling. | | setOptions(opts) | Update count and other options, then re-measure. | | virtualizer | The underlying Virtualizer — the full virtual-core API. | | version(l) | Raw reactive change counter. | | destroy() | Detach observers; call from _onRemove. |

Options are the virtual-core VirtualizerOptions minus getScrollElement (the adapter owns it); observeElementRect, observeElementOffset, scrollToFn, and onChange default to the DOM implementations but can be overridden (e.g. for window virtualization).