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

mnstr-vue

v1.0.1

Published

Vue 3 component library wrapping mnstr

Readme

mnstr-vue

Vue 3 wrapper for mnstr — a high-performance virtualized list & tree renderer that can display very large data sets by only rendering the cells currently in view.

MNSTR itself is framework-agnostic and manages its own scroll node and cells. This package bridges MNSTR's native cell renderer to a Vue slot, so you write your cell template as normal Vue markup.

Install

npm i mnstr-vue

mnstr comes along as a regular dependency. vue is a peer dependency — it uses the Vue already installed in your project (a component library must never bundle its own copy of Vue, or the app ends up with two Vue instances).

Quick start

The default slot is your cell template. It receives the element's own properties plus $index and $expanded as slot props. (For primitive elements — strings, numbers — the value is exposed as $value instead.)

Styles are injected automatically; a single import is all you need.

<script setup>
import { ref } from 'vue'
import { MnstrVue } from 'mnstr-vue'

const elements = ref(
  Array.from({ length: 100_000 }, (_, i) => ({ id: i, name: `Item ${i}` }))
)
</script>

<template>
  <!-- The wrapper MUST have a fixed height (see below). -->
  <div style="height: 400px">
    <MnstrVue :elements="elements">
      <template #default="{ name, $index }">
        <div class="row">{{ $index }} — {{ name }}</div>
      </template>
    </MnstrVue>
  </div>
</template>

⚠️ The container needs a fixed height / max-height. Without it MNSTR has no viewport to virtualize against and will render every element, defeating the purpose. The component fills its parent (height: 100%), so give the parent a height.

Global registration (plugin)

Instead of importing the component everywhere, register it once:

import { createApp } from 'vue'
import MnstrVue from 'mnstr-vue'
import App from './App.vue'

createApp(App).use(MnstrVue).mount('#app')
// <MnstrVue> is now available in every template.

Props

| Prop | Type | Default | Description | | ---------------- | ---------- | ------- | ------------------------------------------------------------------------------------ | | elements | Array | — | Required. The data (getData). Object identity must stay stable — MNSTR compares with ===. | | getChildren | Function | — | Optional. Maps to getElementChildren() for tree data. | | retainPosition | Boolean | true | On a new elements reference, keep the current scroll position. | | options | Object | {} | Any additional MNSTR options (className, updateThresholdRatio, observeCellBounds, …). See the mnstr docs. |

Events

All map directly to the corresponding MNSTR callbacks:

| Event | Payload | | --------------------------------- | --------- | | did-render-first-element | element | | did-render-last-element | element | | first-in-bounds-element-changed | element | | last-in-bounds-element-changed | element | | cells-updated | cells |

Methods (via template ref)

<script setup>
import { ref } from 'vue'
const list = ref(null)
// e.g. list.value.scrollToElement(myElement)
</script>

<template>
  <MnstrVue ref="list" :elements="elements"> … </MnstrVue>
</template>

| Method | Description | | ------------------------------------- | --------------------------------------------------------------------- | | update(force, retainPosition) | Re-render. Call after in-place mutation of the data (see below). | | needUpdate() | Whether MNSTR thinks an update is pending. | | cellBoundsUpdated() | Call when cell heights changed due to reactive slot updates. | | scrollToElement(el, opts) | Scroll a given element into view. | | expandElement(el) / collapseElement(el) / toggleExpandElement(el) | Tree expansion control. | | isElementExpanded(el) | Expansion state of an element. | | exportRestoreState() | Export scroll/expansion state for later restore. | | getInstance() | Escape hatch — the raw MNSTR instance. |

Updating data

The component watches elements by reference only (a deep watch would be prohibitively expensive for large lists):

  • Replacing the array (elements.value = newArray) → updates automatically.
  • Mutating in place (elements.value.push(...)) → call update() on the ref yourself, since the reference didn't change.

How it works

Each cell is rendered with Vue's low-level render() into a DOM node that MNSTR owns. render() patches synchronously, so the DOM exists by the time MNSTR measures cell height — an async approach (e.g. Teleport + nextTick) would report 0-height cells. Detached cells are garbage-collected on every cells-updated, and all mounts are torn down on unmount, so slot content doesn't leak.

For everything about the underlying engine — data shape, tree support, all options and callbacks — see the mnstr documentation.

Develop

npm install
npm run build    # builds ESM + CSS into dist/

License

MIT © Thomas Winkler