Grid
A 24-column Row / Col grid system for page ratios, gutters, offsets, and responsive layout.
Basic Usage
CfRow / CfCol form a 24-column grid system. span=6 is 25%, span=8 is 33.33%, and span=12 is 50%. gutter controls horizontal and vertical spacing, while offset creates left-side blank columns.
100%
25%
25% + offset 6
33.33%
33.33% + offset 8
50%
66.66%
xs=24 / md=12 / lg=8
响应式断点
gutter=[12, 12]
Demo source
<CfRow :gutter="[16, 16]">
<CfCol :span="6">25%</CfCol>
<CfCol :span="12">50%</CfCol>
<CfCol :span="6">25%</CfCol>
</CfRow> <CfRow gutter={[16, 16]}>
<CfCol span={6}>25%</CfCol>
<CfCol span={12}>50%</CfCol>
<CfCol span={6}>25%</CfCol>
</CfRow> Row API
| Prop | Type | Default | Description |
|---|---|---|---|
as | string / ElementType | div | Rendered element |
gutter | number / string / [x, y] | 0 | Horizontal / vertical spacing |
justify | start / center / end / space-around / space-between / space-evenly | start | Horizontal distribution |
align | top / middle / bottom / stretch | top | Vertical alignment |
wrap | boolean | true | Allow wrapping |
Col API
| Prop | Type | Default | Description |
|---|---|---|---|
as | string / ElementType | div | Rendered element |
span | number | 24 | Column span, 0–24 |
offset | number | 0 | Left offset columns |
push | number | 0 | Move right by columns |
pull | number | 0 | Move left by columns |
order | number | 0 | Flex order |
xs / sm / md / lg / xl / xxl | number / ColBreakpointConfig | — | Responsive config |
反馈与讨论
Grid · Discussion