The Practical Theme

Toggle Light/Dark

A grid places its children in evenly-sized columns that shrink, grow, and reflow as the container resizes, without any breakpoints to manage. Drop any number of items into wa-grid and the utility figures out how many fit on each row based on the container's width and the minimum column size you've asked for. It's the quickest way to build card galleries, product listings, dashboards, and any content that should adapt from one column on a phone to several on a desktop.

Set --min-column-size to change the threshold at which items start to wrap, pair wa-grid with a wa-gap-* class to adjust the spacing between cells, or add wa-span-grid to an individual item to make it span every column.

Examples

Grids work especially well for card lists and content designed for browsing.

Size

By default, grid items will wrap when the grid's column size is less than 20ch, but you can set a custom minimum column size using the --min-column-size custom property.

Gap

By default, the gap between grid items uses --wa-space-m from your theme. Add any wa-gap-* class to change the spacing between cells.

Span Grid

You can add wa-span-grid to any grid item to allow it to span all grid columns. With this, the grid item occupies its own grid row.