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 class structure is stable in SSR output
  • Gutter spacing is derived from row negative margins and column padding, so first paint stays aligned
  • Responsive configurations (xs, sm, md, lg, xl) render deterministically from props
  • Alignment props such as justify and align are SSR-safe because they only affect class names

Layout Consistency

Since the Layout components are based entirely on CSS Flexbox styling, they naturally provide SSR-stable output. In Nuxt pages, Row and Col rarely need any client-only handling.

API

Props

Row Props

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

Col Props

PropDescriptionTypeDefault
tagCustom element tagstring'div'
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 columns or responsive config for <768pxnumber | YhColResponsiveValue{}
smResponsive columns or responsive config for >=768pxnumber | YhColResponsiveValue{}
mdResponsive columns or responsive config for >=992pxnumber | YhColResponsiveValue{}
lgResponsive columns or responsive config for >=1200pxnumber | YhColResponsiveValue{}
xlResponsive columns or responsive config for >=1920pxnumber | YhColResponsiveValue{}
theme-overridesComponent-level theme overridesComponentThemeVarsundefined

Events

Both YhRow and YhCol currently do not expose component events.

Slots

ComponentSlot NameDescription
YhRowdefaultRow content
YhColdefaultColumn content

Expose

YhRow and YhCol currently do not expose public instance methods or properties.

Theme Variables

Row and Col are primarily layout primitives based on Flexbox and currently do not define dedicated component-level CSS variables. They still accept themeOverrides for consistency with the library theme system, but no exclusive variable table is consumed in source.

Type Exports

This page documents the grid primitives YhRow and YhCol. Container-family exports such as YhContainer, YhHeader, YhAside, YhMain, and YhFooter are exported from the container module and documented on the Container page.

NameDescription
YhRowPropsProps type for YhRow
YhRowSlotsSlots type for YhRow
YhRowJustifyRow justify union
YhRowAlignRow align union
YhRowContextInjected row context type
YhRowInstancePublic instance type for YhRow
YhColPropsProps type for YhCol
YhColSlotsSlots type for YhCol
YhColResponsiveValueResponsive column config type
YhColInstancePublic instance type for YhCol

Released under the MIT License.