Grid
Quickly and easily create layouts with the basic 24-column.
TIP
The component uses flex layout by default, no need to set type="flex" manually.
Please note that the parent container should avoid using inline related styles, which will cause the component to not fill up its width.
Basic layout
Create basic grid layout using columns. With row and col, we can easily manipulate the layout using the span attribute.
Column spacing
Column spacing is supported. Row provides gutter attribute to specify spacings between columns, and its default value is 0.
Hybrid layout
Form a more complex hybrid layout by combining the basic 1/24 columns.
Column offset
You can specify the number of column offset by setting the value of offset attribute of Col.
Alignment
Default use the flex layout to make flexible alignment of columns. You can define the layout of child elements by setting justify attribute with start, center, end, space-between, space-around or space-evenly.
Justify start
Justify center
Justify end
Justify space-between
Justify space-around
Responsive Layout
Taking example by Bootstrap is responsive design, five breakpoints are preset: xs, sm, md, lg and xl.
Row API
Row Attributes
Name | Description | Type | Default |
---|---|---|---|
gutter | Grid spacing | Number | 0 |
justify | Horizontal alignment of flex layout | String | start |
align | Vertical alignment of flex layout | String | top |
tag | Custom element tag | String | div |
Row Slots
Name | Description | Type |
---|---|---|
default | Customize default content | Col |
Col API
Col Attributes
Name | Description | Type | Default |
---|---|---|---|
span | Number of column the grid spans | Number | 24 |
offset | Number of spacing on the left side of the grid | Number | 0 |
push | Number of columns that grid moves to the right | Number | 0 |
pull | Number of columns that grid moves to the left | Number | 0 |
xs | <768px Responsive columns or column props object | Number Object | - |
sm | ≥768px Responsive columns or column props object | Number Object | - |
md | ≥992px Responsive columns or column props object | Number Object | - |
lg | ≥1200px Responsive columns or column props object | Number Object | - |
xl | ≥1920px Responsive columns or column props object | Number Object | - |
tag | Custom element tag | String | div |
Col Slots
Name | Description | Type |
---|---|---|
default | Customize default content | Col |