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

@yasanchezz/vue-infinite-grid

v0.1.11

Published

Readme

@yasanchezz/vue-infinite-grid

An infinite (virtualized) grid component for Vue 3.5+

VueGrid renders only the rows that fit near the visible viewport (plus a buffer) and keeps scroll height consistent by measuring each rendered row with a ResizeObserver. It relies on CSS Grid + subgrid, so your rows must be laid out as a grid that spans the full width of the component.

Installation

Install the npm package

npm install @yasanchezz/vue-infinite-grid --save

Register it as a global component in main.js

import VueGrid from '@yasanchezz/vue-infinite-grid';
import '@yasanchezz/vue-infinite-grid/dist/vue-infinite-grid.css';

createApp(App)
  .use(VueGrid)
  .mount('#app');

Usage

<template>
  <VueGrid
    ref="grid"
    :rows="rows"
    :rows-count="10"
    :height="200"
    class="my-grid"
  >
    <template #row="{ row }">
      <SubgridComponent
        class="my-subgrid"
        :row="row"
      />
    </template>
  </VueGrid>
</template>

<style lang="scss" scoped>
.my-grid {
  grid-template-columns: repeat(4, 1fr);
}

.my-subgrid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
}
</style>

Each item in rows must have a unique id: string, which VueGrid uses as the :key for the row and to track its measured height.

Props

| Prop | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | rows | GridRow[] ({ id: string }) | yes | - | The full list of rows. Only a window of these is actually rendered at a time. | | rowsCount | number | yes | - | How many rows to render at once (the size of the rendered window). | | height | number | yes | - | Estimated row height in px, used for scroll/offset math before a row has actually been measured. | | container | Element \| null \| ((container: Element \| null) => Element \| null \| undefined) | no | document.documentElement | The scrollable element to listen to. Can be a function that receives the grid's root element (useful for resolving a custom scroll container after mount). | | autoCalculatedRowsCount | boolean | no | false | When true, grows the rendered window beyond rowsCount based on measured row heights so it always covers the viewport (useful when actual row heights are smaller than the estimated height). |

Slots

| Slot | Props | Description | | --- | --- | --- | | row | { row: GridRow } | Renders a single row. Required. |

Exposed methods

| Method | Signature | Description | | --- | --- | --- | | init | () => void | Recalculates the rendered window and layout. Call this after something outside of rows/height changes the available space, e.g. on window resize. | | scrollTo | (id: string) => Promise<HTMLElement> | Scrolls the container to the row with the given id and resolves with that row's DOM element once it has been rendered. |

Usage as a ref

<script setup>
import { useTemplateRef } from 'vue'

const grid = useTemplateRef('grid')

grid.value.scrollTo(rowId) // scroll to a specific row
window.addEventListener('resize', () => grid.value.init()) // recalculate layout on resize
</script>

<template>
  <VueGrid ref="grid" :rows="rows" :rows-count="10" :height="200" />
</template>

Styling notes

VueGrid only controls vertical layout - you're expected to define the column layout on the root element (e.g. grid-template-columns) and have each row use display: grid; grid-template-columns: subgrid; spanning grid-column: 1 / -1 so it inherits those columns.