Components
← All components

Masonry

stimeo--masonry

Packs variable-height cards into the shortest column while keeping DOM order.

The stimeo--masonry controller has no dedicated APG pattern; it is a layout-only helper. It derives a responsive column count from the container width and min-column-width and assigns each item to the currently shortest column, exposing the count on --stimeo-masonry-columns and each item's column index on data-column. A ResizeObserver and a MutationObserver re-run the layout on resize and on item add/remove. Crucially, the DOM order is never changed, so reading order and focus order stay the source order (WCAG 1.3.2) — use it only for independent cards whose visual order carries no meaning. Here the demo feeds --stimeo-masonry-columns into a CSS multi-column layout. Behavior only — the look is yours.

running

Quick note

A short card.

Changelog

A taller card whose extra paragraphs make the column heights uneven, so the shortest-column packing is easy to see.

A taller card whose extra paragraphs make the column heights uneven, so the shortest-column packing is easy to see.

Release notes

A medium card with a couple of lines of supporting copy to vary the height.

Quick note

A short card.

Changelog

A taller card whose extra paragraphs make the column heights uneven, so the shortest-column packing is easy to see.

A medium card with a couple of lines of supporting copy to vary the height.

Release notes

A medium card with a couple of lines of supporting copy to vary the height.