Border layout

A CSS Grid based layout module in the spirit of the classic BorderLayout. Add the border-layout class to a container and place children in the top, start, main, end, and bottom areas with the data-layout attribute. Children without a data-layout attribute land in the main area.

The five regions

The middle row and column stretch to fill the remaining space, while top, bottom, start, and end are sized by their content. The start and end names follow CSS logical directions, so they adapt if you ever change writing direction.

Top
Main
Bottom

Sparse layouts

Regions you leave empty simply collapse, so the same container works for smaller layouts. Here only top, start, and main are used; the bottom row and end column shrink to nothing.

Top
Main

Nested layouts

Because the layout is driven by a class, containers can be nested freely. The main region below holds a second border-layout with its own top, start, and main regions, and the end region of the inner layout stacks a pair of cards.

Top
Top
Main
Bottom