Class Reference

Layout

Class Reference

Layout

Display, flexbox, grid, alignment and responsive visibility.

How to use

Start with flex or grid. Add direction, columns, alignment and gap classes to express the layout. Avoid competing classes that set the same property at the same breakpoint.

Responsive behavior

Tablet and mobile suffixes apply inside their media queries. The unsuffixed class supplies the base layout; narrower breakpoint rules override it at its named breakpoint.

Visual reference

Examples use the installed class styles and your design variables. Each preview includes the context needed to show the class behavior; responsive examples follow the browser width. Guide: tinted area = layout container; blue tiles = items; dashed lines = container and grid-track boundaries.

.blockdisplay: block
Element
Before
Container
Element
After

The surrounding elements show whether the example occupies its own line.

.inline-blockdisplay: inline-block
Element
Before
Container
Element
After

The surrounding elements show whether the example occupies its own line.

.flexdisplay: flex
Element
Before
Container
Element
After

The surrounding elements show whether the example occupies its own line.

.inline-flexdisplay: inline-flex
Element
Before
Container
Element
After

The surrounding elements show whether the example occupies its own line.

.griddisplay: grid · grid-template-rows: none
Element
Before
Container
Element
After

The surrounding elements show whether the example occupies its own line.

.inline-griddisplay: inline-grid
Element
Before
Container
Element
After

The surrounding elements show whether the example occupies its own line.

.hiddendisplay: none
13

Item 2 is hidden; items 1 and 3 remain visible.

.flex-rowflex-direction: row
123

The numbered items show the flow direction.

.flex-columnflex-direction: column
123

The numbered items show the flow direction.

.flex-row-reverseflex-direction: row-reverse
123

The numbered items show the flow direction.

.flex-column-reverseflex-direction: column-reverse
123

The numbered items show the flow direction.

.flex-wrapflex-wrap: wrap
123456

The same six items use equal starting widths. Wrap creates more lines; nowrap keeps one line and allows shrinking.

.flex-nowrapflex-wrap: nowrap
123456

The same six items use equal starting widths. Wrap creates more lines; nowrap keeps one line and allows shrinking.

.flex-wrap-reverseflex-wrap: wrap-reverse
123456

The same six items use equal starting widths. Wrap creates more lines; nowrap keeps one line and allows shrinking.

.growflex-grow: 1
12 · target3

All three items start at one quarter of the available width. Only item 2 carries the class.

.grow-0flex-grow: 0
12 · target3

All three items start at one quarter of the available width. Only item 2 carries the class.

.shrinkflex-shrink: 1
12 · target3

All three items start at 50% of the container width, creating a need to shrink. Only item 2 carries the class.

.shrink-0flex-shrink: 0
12 · target3

All three items start at 50% of the container width, creating a need to shrink. Only item 2 carries the class.

.basis-autoflex-basis: auto
12 · target3

Only item 2 carries the class. The other items start at one quarter of the available width; wrapping reveals the target’s basis.

.basis-fullflex-basis: 100%
12 · target3

Only item 2 carries the class. The other items start at one quarter of the available width; wrapping reveals the target’s basis.

.basis-halfflex-basis: 50%
12 · target3

Only item 2 carries the class. The other items start at one quarter of the available width; wrapping reveals the target’s basis.

.basis-thirdflex-basis: 33.3333%
12 · target3

Only item 2 carries the class. The other items start at one quarter of the available width; wrapping reveals the target’s basis.

.basis-two-thirdsflex-basis: 66.6667%
12 · target3

Only item 2 carries the class. The other items start at one quarter of the available width; wrapping reveals the target’s basis.

.justify-startjustify-content: flex-start
123

Items start at 20% of the container width, leaving free space to show horizontal distribution.

.justify-centerjustify-content: center
123

Items start at 20% of the container width, leaving free space to show horizontal distribution.

.justify-endjustify-content: flex-end
123

Items start at 20% of the container width, leaving free space to show horizontal distribution.

.justify-betweenjustify-content: space-between
123

Items start at 20% of the container width, leaving free space to show horizontal distribution.

.justify-aroundjustify-content: space-around
123

Items start at 20% of the container width, leaving free space to show horizontal distribution.

.justify-evenlyjustify-content: space-evenly
123

Items start at 20% of the container width, leaving free space to show horizontal distribution.

.align-startalign-items: flex-start
123

The container is 180px tall. Different item heights make cross-axis alignment visible.

.align-centeralign-items: center
123

The container is 180px tall. Different item heights make cross-axis alignment visible.

.align-endalign-items: flex-end
123

The container is 180px tall. Different item heights make cross-axis alignment visible.

.align-stretchalign-items: stretch
123

The container is 180px tall. Items stretch to the available height.

.align-baselinealign-items: baseline
123

Different text sizes share the same text baseline; dashed guides mark the baseline.

.align-content-startalign-content: flex-start
123456

Wrapping items inside a taller container make line distribution visible.

.align-content-centeralign-content: center
123456

Wrapping items inside a taller container make line distribution visible.

.align-content-endalign-content: flex-end
123456

Wrapping items inside a taller container make line distribution visible.

.align-content-betweenalign-content: space-between
123456

Wrapping items inside a taller container make line distribution visible.

.align-content-aroundalign-content: space-around
123456

Wrapping items inside a taller container make line distribution visible.

.align-content-evenlyalign-content: space-evenly
123456

Wrapping items inside a taller container make line distribution visible.

.align-content-stretchalign-content: stretch
123456

Wrapping items inside a taller container make line distribution visible.

.self-autoalign-self: auto
12 · target3

Only item 2 carries this class. Items 1 and 3 keep their reference alignment.

.self-startalign-self: flex-start
12 · target3

Only item 2 carries this class. Items 1 and 3 keep their reference alignment.

.self-centeralign-self: center
12 · target3

Only item 2 carries this class. Items 1 and 3 keep their reference alignment.

.self-endalign-self: flex-end
12 · target3

Only item 2 carries this class. Items 1 and 3 keep their reference alignment.

.self-stretchalign-self: stretch
12 · target3

Only item 2 carries this class. Items 1 and 3 keep their reference alignment.

.self-baselinealign-self: baseline
12target3

Only item 2 carries this class. Item 1 supplies the reference text baseline.

.justify-items-startjustify-items: start
123456

Each tile sits inside an equal grid track; smaller tiles reveal start, center and end alignment.

.justify-items-centerjustify-items: center
123456

Each tile sits inside an equal grid track; smaller tiles reveal start, center and end alignment.

.justify-items-endjustify-items: end
123456

Each tile sits inside an equal grid track; smaller tiles reveal start, center and end alignment.

.justify-items-stretchjustify-items: stretch
123456

Each tile sits inside an equal grid track; smaller tiles reveal start, center and end alignment.

.grid-align-startalign-items: start
123456

Different item heights make vertical alignment within grid tracks visible.

.grid-align-endalign-items: end
123456

Different item heights make vertical alignment within grid tracks visible.

.grid-columns-1grid-template-columns: minmax(0, 1fr)
123456

Equal grid tracks fill the available width. Numbered tiles show the column count.

.grid-columns-2grid-template-columns: repeat(2, minmax(0, 1fr))
123456

Equal grid tracks fill the available width. Numbered tiles show the column count.

.grid-columns-3grid-template-columns: repeat(3, minmax(0, 1fr))
123456

Equal grid tracks fill the available width. Numbered tiles show the column count.

.grid-columns-4grid-template-columns: repeat(4, minmax(0, 1fr))
123456

Equal grid tracks fill the available width. Numbered tiles show the column count.

.grid-columns-5grid-template-columns: repeat(5, minmax(0, 1fr))
123456

Equal grid tracks fill the available width. Numbered tiles show the column count.

.grid-columns-6grid-template-columns: repeat(6, minmax(0, 1fr))
123456

Equal grid tracks fill the available width. Numbered tiles show the column count.

.visible-tabletdisplay: none
12 · target3

Item 2 is hidden above 1024px and visible at 1024px or below. Current viewport: desktop (>1024px).Current viewport: tablet (768–1024px).Current viewport: mobile (≤767px).

.visible-mobiledisplay: none
12 · target3

Item 2 is hidden above 767px and visible at 767px or below. Current viewport: desktop (>1024px).Current viewport: tablet (768–1024px).Current viewport: mobile (≤767px).

.image-fill-heightheight: 0px · min-height: 100%
Image placeholderImage placeholder

The frame is at least 240px tall. The image fills that height on desktop; at 1024px or below, it uses its natural aspect ratio. Current viewport: desktop (>1024px).Current viewport: tablet (768–1024px).Current viewport: mobile (≤767px).

.column-span-1grid-column: span 1
12 · target3456

Four equal grid tracks. Only item 2 carries the span class; tile borders show its occupied area.

.column-span-2grid-column: span 2
12 · target3456

Four equal grid tracks. Only item 2 carries the span class; tile borders show its occupied area.

.column-span-3grid-column: span 3
12 · target3456

Four equal grid tracks. Only item 2 carries the span class; tile borders show its occupied area.

.column-span-4grid-column: span 4
12 · target3456

Four equal grid tracks. Only item 2 carries the span class; tile borders show its occupied area.

.column-span-fullgrid-column: 1 / -1
12 · target3456

Four equal grid tracks. Only item 2 carries the span class; tile borders show its occupied area.

.order-firstorder: -999
12 · target3

Only item 2 carries the class; the numbers show its position after ordering.

.order-noneorder: 0
12 · target3

Only item 2 carries the class; the numbers show its position after ordering.

.order-lastorder: 999
12 · target3

Only item 2 carries the class; the numbers show its position after ordering.

.grid-columns-1-tabletgrid-template-columns: minmax(0, 1fr)
123456

This reference grid changes from three columns to one at 1024px or below. Current viewport: desktop (>1024px).Current viewport: tablet (768–1024px).Current viewport: mobile (≤767px).

.grid-columns-2-tabletgrid-template-columns: repeat(2, minmax(0, 1fr))
123456

This reference grid changes from three columns to two at 1024px or below. Current viewport: desktop (>1024px).Current viewport: tablet (768–1024px).Current viewport: mobile (≤767px).

.order-first-tabletorder: -999
12 · target3

Item 2 moves first at 1024px or below. Current viewport: desktop (>1024px).Current viewport: tablet (768–1024px).Current viewport: mobile (≤767px).

.hidden-tabletdisplay: none
12 · target3

Item 2 is visible above 1024px and hidden at 1024px or below. Current viewport: desktop (>1024px).Current viewport: tablet (768–1024px).Current viewport: mobile (≤767px).

.flex-column-mobileflex-direction: column
123

The same three items switch from a row to a column at 767px or below. Current viewport: desktop (>1024px).Current viewport: tablet (768–1024px).Current viewport: mobile (≤767px).

.hidden-mobiledisplay: none
12 · target3

Item 2 is visible above 767px and hidden at 767px or below. Current viewport: desktop (>1024px).Current viewport: tablet (768–1024px).Current viewport: mobile (≤767px).

.grid-columns-1-mobilegrid-template-columns: minmax(0, 1fr)
123456

This reference grid changes from three columns to one at 767px or below. Current viewport: desktop (>1024px).Current viewport: tablet (768–1024px).Current viewport: mobile (≤767px).

NextSpacingExplore spacing classes and how to use them.