Gathering detailed insights and metrics for vue-virtual-grid
Gathering detailed insights and metrics for vue-virtual-grid
Gathering detailed insights and metrics for vue-virtual-grid
Gathering detailed insights and metrics for vue-virtual-grid
vue-virtual-scroll-grid
This is a reusable component for Vue 3 that renders a list with a huge number of items (e.g. 1000+ items) as a grid in a performant way.
@revolist/revogrid
Virtual reactive data grid spreadsheet component - RevoGrid.
@entestat/vue-datagrid
Vue data grid spreadsheet
virtua
A zero-config, fast and small (~3kB) virtual list (and grid) component for React, Vue, Solid and Svelte.
npm install vue-virtual-grid
Typescript
Module System
Node Version
NPM Version
59.1
Supply Chain
97.4
Quality
75.6
Maintenance
50
Vulnerability
99.6
License
v2.5.0: Improve compatibility
Updated on May 05, 2022
v2.4.0: Migrate to Vite builder
Updated on Feb 16, 2022
v2.3.0: Better infinite scroll rendering
Updated on Dec 15, 2020
Events handler for children
Updated on Oct 21, 2020
New interface and loader
Updated on Oct 13, 2020
Bugfix
Updated on Oct 08, 2020
Vue (78.57%)
JavaScript (14.02%)
TypeScript (4.88%)
HTML (2.53%)
Total Downloads
49,943
Last Day
11
Last Week
283
Last Month
1,520
Last Year
13,230
MIT License
55 Stars
58 Commits
15 Forks
4 Watchers
1 Branches
4 Contributors
Updated on Dec 22, 2024
Minified
Minified + Gzipped
Latest Version
2.5.0
Package Id
vue-virtual-grid@2.5.0
Unpacked Size
50.02 kB
Size
14.51 kB
File Count
9
NPM Version
8.5.5
Node Version
14.16.0
Cumulative downloads
Total Downloads
Last Day
-15.4%
11
Compared to previous day
Last Week
-15.5%
283
Compared to previous week
Last Month
33.1%
1,520
Compared to previous month
Last Year
-11.6%
13,230
Compared to previous year
1
18
Virtual Scrolling Grid made for VueJS based on CSS grids.
1npm install --save vue-virtual-grid
Import VirtualGrid from the package:
1import VirtualGrid from 'vue-virtual-grid';
Register it as on of your components:
1components: { 2 VirtualGrid, 3},
In your template you can add:
1<VirtualGrid :items="yourDataSet" :updateFunction="yourGetDataFunction" />
The items
property is requeried and should be an array of the following object:
1{ 2 id: string, // binding id (must be unique) 3 injected?: string, // custom param, pass an object with what you want inside (optional) 4 height: number, // original height of the item 5 width?: number, // original width of the item (optional: if not set, height will not be adjusted by getItemRatioHeight) 6 columnSpan: number, // how many columns will use your item (put 0 if you want the full width) 7 newRow?: boolean, // if the item should appear on the next row (optional) 8 renderComponent: Component // A VueJS component (custom template of your choice) to render the item (passed as prop `item`) 9}
You can update the items
property at any time (and thus decide what can of storage you want to use) and the grid layout will be recomputed.
The VirtualGrid
also takes multiple custom optional functions/variables as properties
updateFunction() => Promise<boolean>
. For synchronous function just return immediately with Promise.resolve(boolean)
for instance.getGridGap(elementWidth: number, windowHeight: number) => number
.getColumnCount(elementWidth: number) => number;
.getWindowMargin(windowHeight: number) => number;
.getItemRatioHeight(height: number, width: number, columnWidth: number) => number;
.updateFunction
.Properties are provided with default functions that you can use or get inspired from in src/utils.ts
.
The function updateFunction
should update the list of items that will be rendered (each item should look like the Item
object presented before) and return (with a Promise) a boolean that signify that the last batch was loaded (bottom reached) or not.
The property injected
does not impact the computation, it is here to pass custom data to the final component.
With default getItemRatioHeight
, in the returned object to your renderComponent
the height property will be recomputed depending on the column size and the width will be set to the column width multiplied by the column span of the item. Note that it will always keep the original ratio.
Important note: the component that will render the item should respect the returned height otherwise there will be a difference between computation and rendering (in other words, you will see glitches).
Last but not least, the resetGrid()
method is exposed to parent in case you want to clear the grid :)
The grid will pass any events attached to it to its children.
1<VirtualGrid @custom-event="someMethod" />
That way, in your children Component, you can emit to this event and use the parent method.
1this.$emit('custom-event', someArguments);
On the demo you can try this by clicking on a section title, it will display an alert box from the parent component.
If you're using Typescript you can import typing for Item
and provide custom typing for injected data:
1import { Item } from 'vue-virtual-grid'; 2 3interface Image { 4 alt: string; 5 url: string; 6} 7 8const item: Item<Image>;
You can also import the typing for utils methods with VirtualGridInterface
.
If you want a live example, you can take a look at the demo (link at the top) and check the corresponding code in example/
.
Anyone is welcome to contribute (this project is not perfect obviously).
1npm ci
1npm run serve:example
1npm run build
1npm run lint
This is based on React work here: https://github.com/jamiebuilds/react-gridlist
Kudos to Jamie!
Corentin Mors |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
Found 2/22 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
27 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-04-28
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More