使用高级 Chakra UI 组件更快地构建 💎

了解更多
跳到内容
文档演练场指南博客
赞助商

网格

用于管理网格布局

源代码Storybook

用法

import { Grid, GridItem } from "@chakra-ui/react"
<Grid>
  <GridItem />
  <GridItem />
</Grid>

示例

列跨度

colSpan 属性传递给 GridItem 以跨列。

跨列

在某些布局中,您可能需要某些网格项跨越特定数量的列或行,而不是均匀分布

rowSpan=2
colSpan=2
colSpan=2
colSpan=4

属性

属性默认值类型
templateColumns
SystemStyleObject['gridTemplateColumns']

autoFlow
SystemStyleObject['gridAutoFlow']

autoRows
SystemStyleObject['gridAutoRows']

autoColumns
SystemStyleObject['gridAutoColumns']

templateRows
SystemStyleObject['gridTemplateRows']

templateAreas
SystemStyleObject['gridTemplateAreas']

column
SystemStyleObject['gridColumn']

row
SystemStyleObject['gridRow']

inline
boolean

上一页

Float

下一页

Group