Skip to content

Layout

Quickly and easily create layouts using the basic 24-column grid.

Basic Layout

Use yh-row and yh-col components to combine layouts via the span attribute.

24
12
12
8
8
8
6
6
6
6
Basic Layout

Column Spacing (Gutter)

Specify the column spacing via the gutter attribute. The default spacing is 0.

6
6
6
6
Column Spacing

Mixed Layout

Arbitrarily extend and combine the basic 24-column grid to form more complex mixed layouts.

16
8
8
8
4
4
Mixed Layout

Column Offset

Specify the number of columns to offset via the offset attribute.

6
6 offset-6
6 offset-6
6 offset-6
Column Offset

Alignment

Use the justify attribute to control the horizontal alignment of elements within a row.

start
start
start
center
center
center
end
end
end
space-between
space-between
space-between
space-around
space-around
space-around
Alignment

Use in Nuxt

Row and Col components perform exceptionally well in Nuxt 3/4 environments. The layout's HTML structure is precisely generated on the server based on parameters like span and gutter, ensuring high stability and responsive consistency for the first screen.

Nuxt Auto Import

SSR Optimized

Use in Nuxt

SSR Notes:

  • ✅ The 24-column grid ratios generate corresponding CSS class names on the server.
  • ✅ Gutter spacing is perfectly realized via server-side negative margins and padding, ensuring no alignment jitter on the first screen.
  • ✅ Responsive configurations (xs, sm, md, lg, xl) generate corresponding media query classes on the server.
  • ✅ Alignment (justify) and vertical alignment (align) take effect on the server.

Layout Consistency

Since the Layout components are based entirely on CSS (Flexbox) styling, they inherently possess 100% SSR consistency. You rarely need to worry about hydration mismatches when using Row/Col in Nuxt pages.

API

Row Props

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

Col Props

PropDescriptionTypeDefault
spanNumber of grid columns occupiednumber24
offsetNumber of grid columns to offset from the leftnumber0
pushNumber of grid columns to move rightnumber0
pullNumber of grid columns to move leftnumber0
xsResponsive grid columns or attribute object for <768pxnumber | object
smResponsive grid columns or attribute object for ≥768pxnumber | object
mdResponsive grid columns or attribute object for ≥992pxnumber | object
lgResponsive grid columns or attribute object for ≥1200pxnumber | object
xlResponsive grid columns or attribute object for ≥1920pxnumber | object
tagCustom element tagstring'div'

Events

Event NameDescriptionCallback Parameters
This component currently has no custom events

Slots

Slot NameDescription
defaultCustom content

Expose

NameDescriptionType
This component currently has no exposed properties

Theme Variables

Row/Col components are primarily based on Flex layout and currently have no specific component-level global CSS variables.

VariableDescriptionDefault
None

Released under the MIT License.