Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
A component that can arrange items according to the type of grids.
![]() | ![]() | ![]() | ![]() |
---|---|---|---|
MasonryGrid | JustifiedGrid | FrameGrid | PackingGrid |
Download dist files from repo directly or install it via npm.
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.data-grid-width
and data-grid-height
attributes, the size of self, child image, and video elements is automatically adjusted until loading is complete.data-grid-skip="true"
attribute, you can omit it even if there are images in itself and child image, and video elements.Grid 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.
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.
isEqualSize
assumes all items are equal. But if there are more than two size-groups, use data-grid-size-group
.
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/react-grid | React port of @egjs/grid | |
@egjs/ngx-grid | Angular port of @egjs/grid | |
@egjs/vue-grid | Vue.js port of @egjs/grid | |
@egjs/svelte-grid | Svelte port of @egjs/grid |
The following are the supported browsers.
Internet Explorer | Chrome | Firefox | Safari | iOS | Android |
---|---|---|---|---|---|
9+ | Latest | Latest | Latest | 7+ | 4+(polyfill 2.2+) |
For anyone interested to develop egjs-grid, follow the instructions below.
Clone the egjs-grid repository and install the dependency modules.
npm start
Run storybook
for development.
Open http://localhost:6006 to view it in the browser.
The page will reload if you make edits.\ You will also see any lint errors in the console.
npm build
Use npm script to build Grid
Two folders will be created after complete build is completed.
To keep the same code style, we adopted ESLint to maintain our code quality. The rules are modified version based on Airbnb JavaScript Style Guide. Setup your editor for check or run below command for linting.
Once you created a branch and done with development, you must perform a test running with npm test
command before your push the code to a remote repository.
Running npm test
command will start Mocha tests via Karma-runner.
If you find a bug, please report to us opening a new Issues on GitHub.
egjs-grid is released under the MIT license.