Skip to content

Layout

Flexbox-based 24-column grid layout container. Use with see-layout-item child component to build flexible page layouts.

Platform Compatibility

App(vue)App(nvue)H5Mini Program

Code Examples

Equal Split

Split a row into three equal parts.

html
<see-layout>
  <see-layout-item :span="8">
    <view class="grid-item">span=8</view>
  </see-layout-item>
  <see-layout-item :span="8">
    <view class="grid-item">span=8</view>
  </see-layout-item>
  <see-layout-item :span="8">
    <view class="grid-item">span=8</view>
  </see-layout-item>
</see-layout>

2:1 Ratio

html
<see-layout>
  <see-layout-item :span="16">
    <view class="grid-item">span=16</view>
  </see-layout-item>
  <see-layout-item :span="8">
    <view class="grid-item">span=8</view>
  </see-layout-item>
</see-layout>

Offset

Use the offset property to push a column to the right.

html
<see-layout>
  <see-layout-item :span="8" :offset="8">
    <view class="grid-item">span=8 offset=8</view>
  </see-layout-item>
</see-layout>

Gap

Set grid spacing via the gap property.

html
<see-layout :gap="16">
  <see-layout-item :span="8">
    <view class="grid-item">span=8</view>
  </see-layout-item>
  <see-layout-item :span="8">
    <view class="grid-item">span=8</view>
  </see-layout-item>
  <see-layout-item :span="8">
    <view class="grid-item">span=8</view>
  </see-layout-item>
</see-layout>

Flex Custom Ratio

Use the flex property instead of span for custom ratio distribution.

html
<see-layout>
  <see-layout-item :flex="2">
    <view class="grid-item">flex=2</view>
  </see-layout-item>
  <see-layout-item :flex="1">
    <view class="grid-item">flex=1</view>
  </see-layout-item>
  <see-layout-item :flex="1">
    <view class="grid-item">flex=1</view>
  </see-layout-item>
</see-layout>

Vertical Direction

Set direction to column for vertical layout.

html
<see-layout direction="column" :gap="10">
  <see-layout-item>
    <view class="grid-item">Row 1</view>
  </see-layout-item>
  <see-layout-item>
    <view class="grid-item">Row 2</view>
  </see-layout-item>
  <see-layout-item>
    <view class="grid-item">Row 3</view>
  </see-layout-item>
</see-layout>

API

Layout Props

PropertyDescriptionTypeDefaultOptions
directionFlex directionstring'row'row / column
wrapFlex wrapstring'wrap'nowrap / wrap / wrap-reverse
justifyMain axis alignmentstring'flex-start'flex-start / flex-end / center / space-between / space-around / space-evenly
alignCross axis alignmentstring'flex-start'flex-start / flex-end / center / stretch / baseline
gapGrid spacingnumber | string0-

Layout Slots

NameDescription
defaultDefault slot for see-layout-item children

LayoutItem Props

PropertyDescriptionTypeDefaultOptions
spanNumber of columns to span (0-24, 0 means auto width by content)number240 - 24
offsetNumber of columns to offset from the leftnumber00 - 24
flexCustom flex ratio (overrides span when set)number--

LayoutItem Slots

NameDescription
defaultDefault slot for column content

Liao ICP No. 2025070134