@egjs/react-grid

中文文档
1.19.1发布于 2026/10/30MITTypeScriptESM + CJS近 30 天下载 3.4万

A React component that can arrange items according to the type of grids

原始使用文档
文档目录8 节
  1. React Grid
  2. Grids
  3. Documents
  4. Download and Installation
  5. How to use
  6. 3. npm start
  7. Bug Report
  8. License

React Grid

npm version     

A React component that can arrange items according to the type of grids.

Demo /  API

Grids

MasonryGridJustifiedGridFrameGridPackingGrid
  • 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.
  • 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.
  • 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.
  • 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.

Documents

Download and Installation

Download dist files from repo directly or install it via npm.

$ npm install @egjs/react-grid

How to use

import { MasonryGrid, JustifiedGrid, FrameGrid, PackingGrid } from "@egjs/react-grid";

<MasonryGrid
  className="container"
  gap={5}
  defaultDirection={"end"}
  align={"justify"}
>
  <div className={"item"}>1</div>
  <div className={"item"}>2</div>
  <div className={"item"}>3</div>
  <div className={"item"}>4</div>
  <div className={"item"}>5</div>
  <div className={"item"}>6</div>
  <div className={"item"}>7</div>
  <div className={"item"}>8</div>
  <div className={"item"}>9</div>
  <div className={"item"}>10</div>
</MasonryGrid>

2. Install dependencies

# Install the dependency modules.
$ npm install

3. npm start

Run storybook for development.

Open http://localhost:6007 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

3. npm build

Use npm script to build Grid

# Build
$ npm run build

Bug Report

If you find a bug, please report to us opening a new Issues on GitHub.

License

egjs-grid is released under the MIT license.

Copyright (c) 2021-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.

版本与发布记录

@egjs/react-grid 共发布 44 个版本,首次发布于 2021/03/26;过去 12 个月发布了 2 个版本。

版本发布日期距今
1.19.1latest2026/10/3014 天前
1.19.02025/12/1211 个月前
1.17.2-beta.2beta2025/11/131 年前
1.17.2-beta.12025/11/131 年前
1.17.2-beta.02025/11/121 年前
1.18.02025/07/031.4 年前

关于 @egjs/react-grid 的常见问题

@egjs/react-grid 是什么?

A React component that can arrange items according to the type of grids

如何安装 @egjs/react-grid?

在项目目录运行 npm install @egjs/react-grid,或使用 pnpm add / yarn add / bun add。

@egjs/react-grid 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@egjs/react-grid 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@egjs/react-grid 可以商用吗?

@egjs/react-grid 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@egjs/react-grid 的下载量有多少?

根据 npm 官方下载统计,@egjs/react-grid 在 2026/10/13 – 2026/11/11 这 30 天内被下载 33,953 次,日均约 1,132 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@egjs/react-grid 还在维护吗?

最新版本 1.19.1 发布于 2026/10/30(14 天前);至今共发布 44 个版本,其中过去 12 个月发布了 2 个;首次发布于 2021/03/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。