F flexr.dev

Layout Recipe

Reverse Stacking Order with Tailwind flex-col-reverse

'flex-col-reverse' stacks children bottom-to-top: the first element in your DOM renders at the bottom of the container. Chat threads and activity feeds use this so the newest message stays visually anchored at the bottom while you append to the end of the list — and as a bonus, the browser keeps the scroll position pinned there. Note that only the visual order flips; screen readers and tab order still follow the DOM.

The playground below is pre-configured with this exact layout — tweak any control to explore, then copy the Tailwind or vanilla CSS from the exporter.

Live Preview

Current Layout:

Flexbox column reversal vs. CSS Grid reversal

This guide covers Flexbox column structures — flipping the stacking order of items inside a flex container with flex-col-reverse, the pattern behind bottom-anchored chat feeds and activity logs.

Reversing a CSS Grid works differently: it uses order-* utilities, grid-flow-*, and dir="rtl" rather than Flexbox classes. If you are trying to reverse grid rows or columns, head to Reversing Item Order in Tailwind CSS Grid instead.

Popular Layout Guides