{"id":13494563,"url":"https://github.com/naver/egjs-grid","last_synced_at":"2025-05-15T05:07:32.875Z","repository":{"id":37714133,"uuid":"351312185","full_name":"naver/egjs-grid","owner":"naver","description":"A component that can arrange items according to the type of grids","archived":false,"fork":false,"pushed_at":"2025-01-06T05:06:02.000Z","size":17263,"stargazers_count":297,"open_issues_count":13,"forks_count":17,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-15T05:07:24.108Z","etag":null,"topics":["egjs","frame","grid","image","justified","layout","masonry","packing","react","video","vue"],"latest_commit_sha":null,"homepage":"https://naver.github.io/egjs-grid/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-25T04:49:29.000Z","updated_at":"2025-05-13T10:29:25.000Z","dependencies_parsed_at":"2024-02-05T04:36:14.456Z","dependency_job_id":"e6ad793b-65a0-4651-99cc-85048f514d82","html_url":"https://github.com/naver/egjs-grid","commit_stats":{"total_commits":95,"total_committers":5,"mean_commits":19.0,"dds":"0.19999999999999996","last_synced_commit":"ad9b66a11a33a252a58c93df8ff8d580b9c6b442"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Fegjs-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Fegjs-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Fegjs-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Fegjs-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naver","download_url":"https://codeload.github.com/naver/egjs-grid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254276447,"owners_count":22043867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["egjs","frame","grid","image","justified","layout","masonry","packing","react","video","vue"],"created_at":"2024-07-31T19:01:26.034Z","updated_at":"2025-05-15T05:07:27.866Z","avatar_url":"https://github.com/naver.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align=\"middle\" \u003e\u003cimg src=\"https://naver.github.io/egjs-grid/images/logo.png\" /\u003e\u003c/p\u003e\n\u003ch2 align=\"middle\"\u003eGrid\u003c/h2\u003e\n\u003cp align=\"middle\"\u003e\n\u003ca href=\"https://www.npmjs.com/package/@egjs/grid\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@egjs/grid.svg?style=flat-square\u0026color=007acc\u0026label=version\" alt=\"npm version\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003cimg src=\"https://img.shields.io/badge/language-typescript-blue.svg?style=flat-square\" /\u003e\u0026nbsp;\n\u003ca href=\"https://github.com/naver/egjs-grid/actions\" target=\"_blank\"\u003e\u003cimg alt=\"Github actions\" src=\"https://img.shields.io/github/actions/workflow/status/naver/egjs-grid/run-e2e.yml?branch=main\u0026style=flat-square\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://coveralls.io/github/naver/egjs-grid?branch=main\u0026style=flat-square\" target=\"_blank\"\u003e\u003cimg alt=\"Coveralls github\" src=\"https://img.shields.io/coveralls/github/naver/egjs-grid.svg?style=flat-square\u0026label=%E2%9C%85%20coverage\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://github.com/naver/egjs-grid/blob/main/LICENSE\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?style=flat-square\u0026label=license\u0026message=MIT\u0026color=08CE5D\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://github.com/naver/egjs-grid/tree/main/packages/react-grid\" target=\"_blank\"\u003e\u003cimg alt=\"React\" src=\"https://img.shields.io/static/v1.svg?label=\u0026message=React\u0026style=flat-square\u0026color=61daeb\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://github.com/naver/egjs-grid/tree/main/packages/ngx-grid\" target=\"_blank\"\u003e\u003cimg alt=\"Angular\" src=\"https://img.shields.io/static/v1.svg?label=\u0026message=Angular\u0026style=flat-square\u0026color=C82B38\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://github.com/naver/egjs-grid/tree/main/packages/vue-grid\" target=\"_blank\"\u003e\u003cimg\n    alt=\"Vue\"\n    src=\"https://img.shields.io/static/v1.svg?label=\u0026message=Vue\u0026style=flat-square\u0026color=3fb984\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://github.com/naver/egjs-grid/tree/main/packages/svelte-grid\" target=\"_blank\"\u003e\u003cimg alt=\"Svelte\" src=\"https://img.shields.io/static/v1.svg?label=\u0026message=Svelte\u0026style=flat-square\u0026color=C82B38\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"middle\"\u003eA component that can arrange items according to the type of grids.\u003c/p\u003e\n\u003cp align=\"middle\"\u003e\n    \u003ca href=\"https://naver.github.io/egjs-grid\" target=\"_blank\"\u003e\u003cstrong\u003eDemo\u003c/strong\u003e\u003c/a\u003e /\u0026nbsp;\n    \u003ca href=\"https://naver.github.io/egjs-grid/release/latest/doc/\" target=\"_blank\"\u003e\u003cstrong\u003eAPI\u003c/strong\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n## Grids\n\n|\u003cimg src=\"https://naver.github.io/egjs-grid/images/MasonryGrid.png\" /\u003e|\u003cimg src=\"https://naver.github.io/egjs-grid/images/JustifiedGrid.png\" /\u003e|\u003cimg src=\"https://naver.github.io/egjs-grid/images/FrameGrid.png\" /\u003e|\u003cimg src=\"https://naver.github.io/egjs-grid/images/PackingGrid.png\" /\u003e|\n|:---:|:---:|:---:|:---:|\n|[**MasonryGrid**](http://naver.github.io/egjs-grid/storybook/?path=/story/examples-masonrygrid--masonry-grid-template)|[**JustifiedGrid**](http://naver.github.io/egjs-grid/storybook/?path=/story/examples-justifiedgrid--justified-grid-template)|[**FrameGrid**](http://naver.github.io/egjs-grid/storybook/?path=/story/examples-framegrid--frame-grid-template)|[**PackingGrid**](http://naver.github.io/egjs-grid/storybook/?path=/story/examples-packinggrid--packing-grid-template)|\n\n* **MasonryGrid**: The MasonryGrid is a grid that stacks items with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new item.\n* **JustifiedGrid**: 'justified' is a printing term with the meaning that 'it fits in one row wide'. The JustifiedGrid is a grid that the item is filled up on the basis of a line given a size.\n* **FrameGrid**: 'Frame' is a printing term with the meaning that 'it fits in one row wide'. The FrameGrid is a grid that the item is filled up on the basis of a line given a size.\n* **PackingGrid**: The PackingGrid is a grid that shows the important items bigger without sacrificing the weight of the items. Rows and columns are separated so that items are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion.\n\n\n## Documents\n- [Get Started and Demos](https://naver.github.io/egjs-grid/)\n- [API documentation](https://naver.github.io/egjs-grid/release/latest/doc/)\n\n## Download and Installation\n\nDownload dist files from repo directly or install it via npm.\n\n```bash\n$ npm install @egjs/grid\n```\n\n```html\n\u003cscript src=\"//naver.github.io/egjs-grid/release/latest/dist/grid.min.js\"\u003e\u003c/script\u003e\n```\n\n## How to use\n```js\nimport { MasonryGrid, JustifiedGrid, FrameGrid, PackingGrid } from \"@egjs/grid\";\n\n\n// Grid.MasonryGrid\nconst grid = new MasonryGrid(container, {\n  gap: 5,\n});\n\ngrid.renderItems();\n```\n\n## Use Faster \u0026 Lazy Rendering\n\n* When the `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.\n```html\n\u003cimg src=\"...\" /\u003e\n\u003cimg src=\"...\" /\u003e\n\u003cimg src=\"...\" loading=\"lazy\" /\u003e\n\u003cimg data-grid-lazy=\"true\" /\u003e\n```\n* If you use `data-grid-width` and `data-grid-height` attributes, the size of self, child image, and video elements is automatically adjusted until loading is complete.\n```html\n\u003cdiv data-grid-width=\"100\" data-grid-height=\"100\"\u003e\n   \u003cimg src=\"...\" /\u003e\n   \u003cimg src=\"...\" /\u003e\n   \u003cimg src=\"...\" /\u003e\n\u003c/div\u003e\n```\n\n* If you use `data-grid-skip=\"true\"` attribute, you can omit it even if there are images in itself and child image, and video elements.\n```html\n\u003cdiv data-grid-skip=\"true\"\u003e\n   \u003cimg src=\"...\" /\u003e\n   \u003cimg src=\"...\" /\u003e\n   \u003cimg src=\"...\" /\u003e\n\u003c/div\u003e\n```\n\n## Detect resize of Container \u0026 Children\nGrid 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.\n\nIn this case, I recommend [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) for you.\n\nProvides `useResizeObserver` option to detect size change of container and `observeChildren` option to detect size change of children.\n\n\n```js\nimport { MasonryGrid, JustifiedGrid, FrameGrid, PackingGrid } from \"@egjs/grid\";\n\n\n// Grid.MasonryGrid\nconst grid = new MasonryGrid(container, {\n  gap: 5,\n  useResizeObserver: true,\n  observeChildren: true,\n});\n\ngrid.renderItems();\n```\n\n## Pre-guess size for performance or invisible items.\n### What if all items were the same size?\nIf you use the `isEqualSize` option, all items are considered to be the same size.\nEach resize only calculates the size of one item.\nAdd `data-grid-not-equal-size=\"true\"` attribute if there is an exceptional item whose size needs to be calculated while using isEqualSize.\n```html\n\u003cdiv class=\"item item1\"\u003e\u003c/div\u003e\n\u003cdiv class=\"item item1\"\u003e\u003c/div\u003e\n\u003cdiv class=\"item item1\"\u003e\u003c/div\u003e\n\u003c!--item2 is a different size than item1.--\u003e\n\u003cdiv class=\"item item2\" data-grid-not-equal-size=\"true\"\u003e\u003c/div\u003e\n```\n\n### What if a size group exists?\n\n`isEqualSize` assumes all items are equal. But if there are more than two size-groups, use `data-grid-size-group`.\n\n\n```html\n\u003c!--item1 has the same size.--\u003e\n\u003cdiv class=\"item item1\" data-grid-size-group=\"1\"\u003e\u003c/div\u003e\n\u003cdiv class=\"item item1\" data-grid-size-group=\"1\"\u003e\u003c/div\u003e\n\u003c!--item2 has the same size.--\u003e\n\u003cdiv class=\"item item2\" data-grid-size-group=\"2\"\u003e\u003c/div\u003e\n\u003cdiv class=\"item item2\" data-grid-size-group=\"2\"\u003e\u003c/div\u003e\n```\n\n\n### What if all items don't change size?\nIf all items do not have a constant size, use the `isConstantSize` option. Resizing doesn't calculate the item's size.\nIf you want to recalculate, use `.updateItems(items, { useOrgResize: true })` method or `.renderItems({ useOrgResize: true })` method.\n\n\n\n## Packages\n|Package|Version|Description|\n|:-----:|:-----:|:-----:|\n|[**@egjs/react-grid**](https://github.com/naver/egjs-grid/blob/main/packages/react-grid/README.md)|\u003ca href=\"https://www.npmjs.com/package/@egjs/react-grid\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@egjs/react-grid.svg?style=flat-square\u0026color=00d8ff\u0026label=%F0%9F%94%96\" alt=\"version\" /\u003e\u003c/a\u003e|[React](https://reactjs.org/) port of @egjs/grid|\n|[**@egjs/ngx-grid**](https://github.com/naver/egjs-grid/blob/main/packages/ngx-grid/README.md)|\u003ca href=\"https://www.npmjs.com/package/@egjs/ngx-grid\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@egjs/ngx-grid.svg?style=flat-square\u0026color=dd0031\u0026label=%F0%9F%94%96\" alt=\"version\" /\u003e\u003c/a\u003e| [Angular](https://angular.io/) port of @egjs/grid|\n|[**@egjs/vue-grid**](https://github.com/naver/egjs-grid/blob/main/packages/vue-grid/README.md)|\u003ca href=\"https://www.npmjs.com/package/@egjs/vue-grid\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@egjs/vue-grid.svg?style=flat-square\u0026color=42b883\u0026label=%F0%9F%94%96\" alt=\"version\" /\u003e\u003c/a\u003e| [Vue.js](https://vuejs.org/v2/guide/index.html) port of @egjs/grid|\n|[**@egjs/svelte-grid**](https://github.com/naver/egjs-grid/blob/main/packages/svelte-grid/README.md)|\u003ca href=\"https://www.npmjs.com/package/@egjs/svelte-grid\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@egjs/svelte-grid.svg?style=flat-square\u0026color=ff3d00\u0026label=%F0%9F%94%96\" alt=\"version\" /\u003e\u003c/a\u003e| [Svelte](https://svelte.dev/) port of @egjs/grid|\n\n\n## Supported Browsers\nThe following are the supported browsers.\n\n|Internet Explorer|Chrome|Firefox|Safari|iOS|Android|\n|---|---|---|---|---|---|\n|9+|Latest|Latest|Latest|7+|4+(polyfill 2.2+)|\n\n\n\n## How to start developing egjs-grid?\n\nFor anyone interested to develop egjs-grid, follow the instructions below.\n\n### Development Environment\n\n#### 1. Clone the repository\n\nClone the egjs-grid repository and install the dependency modules.\n\n```bash\n# Clone the repository.\n$ git clone https://github.com/naver/egjs-grid.git\n```\n\n#### 2. Install dependencies\n\n```\n# Install the dependency modules.\n$ npm install\n```\n### 3. `npm start`\n\nRun `storybook` for development.\n\nOpen [http://localhost:6006](http://localhost:6006) to view it in the browser.\n\nThe page will reload if you make edits.\\\nYou will also see any lint errors in the console.\n\n#### 3. `npm build`\n\nUse npm script to build Grid\n\n```bash\n$ npm run build\n```\n\nTwo folders will be created after complete build is completed.\n\n- **dist** folder: Includes the **grid.js** and **grid.min.js** files.\n- **doc** folder: Includes API documentation. The home page for the documentation is **doc/index.html**.\n\n### Linting\n\nTo keep the same code style, we adopted [ESLint](http://eslint.org/) to maintain our code quality. The [rules](https://github.com/naver/eslint-config-naver/tree/main/rules) are modified version based on [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript).\nSetup your editor for check or run below command for linting.\n\n```bash\n$ npm run lint\n```\n\n### Test\n\nOnce 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.\n\n```bash\n$ npm run test\n```\nRunning `npm test` command will start [Mocha](https://mochajs.org/) tests via [Karma-runner](https://karma-runner.github.io/).\n\n\n## Bug Report\n\nIf you find a bug, please report to us opening a new [Issues](https://github.com/naver/egjs-grid/issues) on GitHub.\n\n\n## License\negjs-grid is released under the [MIT license](https://github.com/naver/egjs/blob/master/LICENSE.txt).\n\n```\nCopyright (c) 2021-present NAVER Corp.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaver%2Fegjs-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaver%2Fegjs-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaver%2Fegjs-grid/lists"}