element-plus-design-layout

v2026.09.25

Layout grid system for Element Plus using 24-column grid. Invoke when user needs to create responsive layouts, grid systems, or understand Row and Col components.

GitHub
Install command
npx skhub add jiaiyan/element-plus-design-layout
Markdown
SKILL.md

Layout Grid System

Element Plus provides a 24-column grid system for quickly and easily creating responsive layouts.

When to Use

  • Creating responsive grid layouts
  • Building page structures
  • Implementing column-based designs
  • Responsive design with breakpoints

Basic Concepts

  • 24-column system: The basic unit is 1, with a maximum of 24 and a minimum of 0
  • Flex layout: Uses flex layout by default
  • Responsive: Five breakpoints preset: xs, sm, md, lg, xl

Basic Layout

Create basic grid layout using Row and Col components with the span attribute.

<template>
  <el-row>
    <el-col :span="24"><div class="grid-content">24</div></el-col>
  </el-row>
  <el-row>
    <el-col :span="12"><div class="grid-content">12</div></el-col>
    <el-col :span="12"><div class="grid-content">12</div></el-col>
  </el-row>
  <el-row>
    <el-col :span="8"><div class="grid-content">8</div></el-col>
    <el-col :span="8"><div class="grid-content">8</div></el-col>
    <el-col :span="8"><div class="grid-content">8</div></el-col>
  </el-row>
</template>

Column Spacing

Row provides gutter attribute to specify spacings between columns.

<template>
  <el-row :gutter="20">
    <el-col :span="6"><div class="grid-content">6</div></el-col>
    <el-col :span="6"><div class="grid-content">6</div></el-col>
    <el-col :span="6"><div class="grid-content">6</div></el-col>
    <el-col :span="6"><div class="grid-content">6</div></el-col>
  </el-row>
</template>

Column Offset

Specify column offsets using the offset attribute.

<template>
  <el-row :gutter="20">
    <el-col :span="6"><div class="grid-content">6</div></el-col>
    <el-col :span="6" :offset="6"><div class="grid-content">6 offset 6</div></el-col>
  </el-row>
</template>

Alignment

Use flex layout for flexible alignment with the justify attribute.

<template>
  <el-row justify="center">
    <el-col :span="6"><div class="grid-content">center</div></el-col>
  </el-row>
  <el-row justify="end">
    <el-col :span="6"><div class="grid-content">end</div></el-col>
  </el-row>
  <el-row justify="space-between">
    <el-col :span="6"><div class="grid-content">space-between</div></el-col>
    <el-col :span="6"><div class="grid-content">space-between</div></el-col>
  </el-row>
</template>

Justify Options

ValueDescription
startAlign items to the start
endAlign items to the end
centerCenter items
space-aroundEqual space around items
space-betweenEqual space between items
space-evenlyEqual space between and around items

Responsive Layout

Five breakpoints are preset based on Bootstrap's responsive design:

BreakpointScreen Width
xs< 768px
sm≥ 768px
md≥ 992px
lg≥ 1200px
xl≥ 1920px
<template>
  <el-row :gutter="10">
    <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4">
      <div class="grid-content">Responsive</div>
    </el-col>
    <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="4">
      <div class="grid-content">Responsive</div>
    </el-col>
  </el-row>
</template>

Responsive Object Syntax

<template>
  <el-col :xs="{ span: 24, offset: 0 }" :sm="{ span: 12, offset: 2 }">
    <div class="grid-content">Responsive with offset</div>
  </el-col>
</template>

Utility Classes for Hiding Elements

Import the CSS file to use hiding utility classes:

import 'element-plus/theme-chalk/display.css'

Available Classes

ClassDescription
hidden-xs-onlyHide on extra small viewports only
hidden-sm-onlyHide on small viewports only
hidden-sm-and-downHide on small viewports and down
hidden-sm-and-upHide on small viewports and up
hidden-md-onlyHide on medium viewports only
hidden-md-and-downHide on medium viewports and down
hidden-md-and-upHide on medium viewports and up
hidden-lg-onlyHide on large viewports only
hidden-lg-and-downHide on large viewports and down
hidden-lg-and-upHide on large viewports and up
hidden-xl-onlyHide on extra large viewports only

API Reference

Row Attributes

NameDescriptionTypeDefault
gutterGrid spacingnumber0
justifyHorizontal alignment'start' | 'end' | 'center' | 'space-around' | 'space-between' | 'space-evenly''start'
alignVertical alignment'top' | 'middle' | 'bottom'—
tagCustom element tagstring'div'

Col Attributes

NameDescriptionTypeDefault
spanNumber of columns the grid spansnumber24
offsetNumber of spacing on the left sidenumber0
pushNumber of columns to move rightnumber0
pullNumber of columns to move leftnumber0
xs<768px Responsive columnsnumber | object—
sm≥768px Responsive columnsnumber | object—
md≥992px Responsive columnsnumber | object—
lg≥1200px Responsive columnsnumber | object—
xl≥1920px Responsive columnsnumber | object—
tagCustom element tagstring'div'

Best Practices

  1. Use gutter: Add spacing between columns for better readability
  2. Responsive design: Use breakpoint props for mobile-first design
  3. Avoid inline styles: Parent containers should avoid inline styles
  4. Combine with Container: Use with Container for full page layouts
Discovery
Tags

No tags published for this skill.

Version
Latest version metadata

Version

v2026.09.25

Published

Sep 25, 2026

Category

Uncategorized

License

MIT

Source path

element-plus-design-layout

Default branch

main

Latest commit

1d126b3

Tree SHA

9ae2f92