@egjs/infinitegrid

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

Usage no npm install needed!

<script type="module">
  import egjsInfinitegrid from 'https://cdn.skypack.dev/@egjs/infinitegrid';
</script>

README

InfiniteGrid Logo
@egjs/infinitegrid

version npm weekly downloads npm bundle size (scoped) Travis (.org) Coveralls github GitHub

Angular React Vue Svelte

Demo / Documentation / Other components

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
📱💻🖥

Supported Frameworks
AngularJS   React   Vue.js   Svelte


✨ Features

  • Use it in a framework you like.
    • We supports all major JS frameworks like React, Vue, Angular
  • Restore state like position and active slide with persist
  • Supports both Desktop & Mobile
  • Support Dynamic Options
  • Rich API

📖 Articles

⚙️ Installation

npm

$ npm install --save @egjs/infinitegrid

CDN

🏃 Quick Start

HTML

<div class="container"></div>

ES Modules

import { MasonryInfiniteGrid } from "@egjs/infinitegrid";

const ig = new MasonryInfiniteGrid(".container", { gap: 5 });

With CDN

<!-- Packaged with all dependencies -->
<!-- https://naver.github.io/egjs-infinitegrid/release/latest/dist/infinitegrid.min.js -->
<script src="https://unpkg.com/@egjs/infinitegrid/dist/infinitegrid.min.js"></script>
var ig = new InfiniteGrid.MasonryInfiniteGrid(".container", { gap: 5 });
import { MasonryInfiniteGrid } from "@egjs/infinitegrid";

function getItems(nextGroupKey, count) {
  const nextItems = [];

  for (let i = 0; i < count; ++i) {
    const num = nextGroupKey * count + i;
    nextItems.push(`<div class="item"></div>`);
  }
  return nextItems;
}
const ig = new MasonryInfiniteGrid(".container", {
  gap: 5,
});

ig.on("requestAppend", (e) => {
  const nextGroupKey = (+e.groupKey || 0) + 1;

  ig.append(getItems(nextGroupKey, 10), nextGroupKey);
});
ig.renderItems();

📦 Packages

Package Version Description
@egjs/ngx-infinitegrid version Angular Angular port of @egjs/infinitegrid
@egjs/react-infinitegrid version React React port of @egjs/infinitegrid
@egjs/vue-infinitegrid version Vue.js Vue.js@2 port of @egjs/infinitegrid
@egjs/vue3-infinitegrid version Vue.js Vue.js@3 port of @egjs/infinitegrid
@egjs/svelte-infinitegrid version Svelte Svelte port of @egjs/infinitegrid

🌐 Supported Browsers

IE Chrome Firefox Safari iOS Android
9+(With polyfill), 11+ for Angular & Svelte Latest Latest Latest 7+ 4+

📼 Demos

Check our Demos.

📖 Documentation

See Documentation page.

🙌 Contributing

See CONTRIBUTING.md.

📝 Feedback

Please file an Issue.

🛣️ Roadmap

See our Roadmap.

📜 License

@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.