Gathering detailed insights and metrics for @egjs/infinitegrid
Gathering detailed insights and metrics for @egjs/infinitegrid
Gathering detailed insights and metrics for @egjs/infinitegrid
Gathering detailed insights and metrics for @egjs/infinitegrid
@egjs/react-infinitegrid
A React component that can arrange items infinitely according to the type of grids
@egjs/vue3-infinitegrid
A Vue3 component that can arrange items infinitely according to the type of grids
@egjs/vue-infinitegrid
A Vue component that can arrange items infinitely according to the type of grids
@egjs/svelte-infinitegrid
A Svelte component that can arrange items infinitely according to the type of grids
A module used to arrange card elements including content infinitely on a grid layout.
npm install @egjs/infinitegrid
Typescript
Module System
Node Version
NPM Version
4.12.0 Release (2024-07-02)
Updated on Jul 02, 2024
4.11.1 Release (2024-02-07)
Updated on Feb 07, 2024
4.10.1 Release (2023-08-04)
Updated on Aug 04, 2023
4.10.0 Release (2023-05-26)
Updated on May 26, 2023
4.9.0 Release (2023-03-17)
Updated on Mar 17, 2023
4.8.1 Release (2023-01-27)
Updated on Jan 27, 2023
TypeScript (43.19%)
MDX (40.78%)
HTML (6.43%)
JavaScript (3.86%)
Vue (2.46%)
CSS (1.46%)
Svelte (1.28%)
Sass (0.53%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2,296 Stars
829 Commits
96 Forks
27 Watchers
5 Branches
17 Contributors
Updated on Jul 14, 2025
Latest Version
4.12.0
Package Id
@egjs/infinitegrid@4.12.0
Unpacked Size
1.60 MB
Size
366.18 kB
File Count
49
NPM Version
8.3.1
Node Version
16.14.0
Published on
Jul 02, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
63
A module used to arrange elements including content infinitely according to grid type. With this module, you can implement various grids composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance
📱💻🖥
1$ npm install --save @egjs/infinitegrid
1<div class="container"></div>
1import { MasonryInfiniteGrid } from "@egjs/infinitegrid"; 2 3const ig = new MasonryInfiniteGrid(".container", { gap: 5 });
1<!-- Packaged with all dependencies --> 2<!-- https://naver.github.io/egjs-infinitegrid/release/latest/dist/infinitegrid.min.js --> 3<script src="https://unpkg.com/@egjs/infinitegrid/dist/infinitegrid.min.js"></script>
1var ig = new InfiniteGrid.MasonryInfiniteGrid(".container", { gap: 5 });
1import { MasonryInfiniteGrid } from "@egjs/infinitegrid"; 2 3function getItems(nextGroupKey, count) { 4 const nextItems = []; 5 6 for (let i = 0; i < count; ++i) { 7 const num = nextGroupKey * count + i; 8 nextItems.push(`<div class="item"></div>`); 9 } 10 return nextItems; 11} 12const ig = new MasonryInfiniteGrid(".container", { 13 gap: 5, 14}); 15 16ig.on("requestAppend", (e) => { 17 const nextGroupKey = (+e.groupKey || 0) + 1; 18 19 ig.append(getItems(nextGroupKey, 10), nextGroupKey); 20}); 21ig.renderItems();
loading="lazy"
or data-grid-lazy="true"
(external lazy loading) attribute is used, Rendering of the items occurs immediately. When items are loaded, they are rendered sequentially.1<img src="..." /> 2<img src="..." /> 3<img src="..." loading="lazy" /> 4<img data-grid-lazy="true" />
data-grid-width
and data-grid-height
attributes, the size of self, child image, and video elements is automatically adjusted until loading is complete.1<div data-grid-width="100" data-grid-height="100"> 2 <img src="..." /> 3 <img src="..." /> 4 <img src="..." /> 5</div>
data-grid-skip="true"
attribute, you can omit it even if there are images in itself and child image, and video elements.1<div data-grid-skip="true"> 2 <img src="..." /> 3 <img src="..." /> 4 <img src="..." /> 5</div>
InfiniteGrid calculates the size of container and children by window resizing event. However, even if the size of the window does not change, the size of the event container and children can change. Most of the first rendering issues are also like this.
In this case, I recommend ResizeObserver for you.
Provides useResizeObserver
option to detect size change of container and observeChildren
option to detect size change of children.
1import { MasonryInfiniteGrid, JustifiedInfiniteGrid, FrameInfiniteGrid, PackingInfiniteGrid } from "@egjs/infinitegrid";
2
3
4// InfiniteGrid.MasonryInfiniteGrid
5const grid = new MasonryInfiniteGrid(container, {
6 gap: 5,
7 useResizeObserver: true,
8 observeChildren: true,
9});
10
11grid.renderItems();
If you use the isEqualSize
option, all items are considered to be the same size.
Each resize only calculates the size of one item.
Add data-grid-not-equal-size="true"
attribute if there is an exceptional item whose size needs to be calculated while using isEqualSize.
1<div class="item item1"></div> 2<div class="item item1"></div> 3<div class="item item1"></div> 4<!--item2 is a different size than item1.--> 5<div class="item item2" data-grid-not-equal-size="true"></div>
isEqualSize
assumes all items are equal. But if there are more than two size-groups, use data-grid-size-group
.
1<!--item1 has the same size.--> 2<div class="item item1" data-grid-size-group="1"></div> 3<div class="item item1" data-grid-size-group="1"></div> 4<!--item2 has the same size.--> 5<div class="item item2" data-grid-size-group="2"></div> 6<div class="item item2" data-grid-size-group="2"></div>
If all items do not have a constant size, use the isConstantSize
option. Resizing doesn't calculate the item's size.
If you want to recalculate, use .updateItems(items, { useOrgResize: true })
method or .renderItems({ useOrgResize: true })
method.
Package | Version | Description |
---|---|---|
@egjs/infinitegrid | Vanilla Module of InfiniteGrid | |
@egjs/ngx-infinitegrid | ||
@egjs/react-infinitegrid | ||
@egjs/vue-infinitegrid | ||
@egjs/vue3-infinitegrid | ||
@egjs/svelte-infinitegrid |
9+(With polyfill), 11+ for Angular & Svelte | Latest | Latest | Latest | 7+ | 4+ |
Check our Demos.
See Documentation page.
See CONTRIBUTING.md.
Please file an Issue.
See our Roadmap.
@egjs/infinitegrid is released under the MIT license.
Copyright (c) 2015-present NAVER Corp.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 14/30 approved changesets -- score normalized to 4
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
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
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
163 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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