Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Zalando Engineering 6 min read How-to mediumAdept

Flexbox Layout Behavior in Jetpack Compose

Most CSS flexbox layout concepts map directly onto Jetpack Compose primitives. Row and Column cover flex direction, the weight() modifier covers flex grow, and Arrangement and Alignment parameters cover justify-content and align-items/align-self. Stretch maps to fillMax* modifiers, and Box with align() handles absolute positioning. Gaps remain: flex wrap relied on the now-deprecated FlowRow/FlowColumn, Compose has no flex shrink (IntrinsicSize.Min can sometimes stand in), and there is no cross-axis space-between, so custom Layout or ConstraintLayout is needed for full flexbox behavior. Zalando is evaluating Compose as a successor to Litho for its backend-driven screens.

Related posts

  • Adopting Jetpack Compose for Etsy’s Android App

    Etsy Code as Craft mediumAdept

    Etsy adopted Jetpack Compose as its preferred Android UI toolkit through a staged rollout. It started with an internal curriculum and Compose versions of design system components, then moved to an internal-only screen, then user-facing bottom sheets, and finally a three-month rewrite of the Shop screen paired with the Macramé unidirectional-data-flow architecture. An A/B test showed 5% faster initial render and improvements in conversion, add-to-cart and other engagement metrics, and engineers reported less code, better test coverage and value from Compose Previews. Pain points included an alpha-stage third-party library and the different key and item-reuse semantics of LazyRow/LazyColumn compared with RecyclerView.

  • Introducing CSS Grid Lanes

    WebKit mediumAdept

    CSS Grid Lanes (`display: grid-lanes`) brings native masonry layouts to the web, available in Safari Technology Preview 234. Lanes are defined with standard `grid-template-columns` or `grid-template-rows`. Each item goes into whichever lane leaves it closest to the start, so tab order follows visible content and infinite scroll needs no JavaScript layout. Grid features such as spanning, explicit placement and varied lane sizes all work, and flow direction (waterfall vs. brick) is inferred from which template is defined. A new `fit-tolerance` property (default 1em, formerly `item-tolerance`/`flow-tolerance`) treats near-equal lane heights as ties to reduce reordering that confuses keyboard and screen reader users.

  • CSS Grid: A helpful mental model and the power of grid lines

    WebKit mediumAdept

    CSS Grid becomes easier to reason about when a layout starts from the container, treated like a spreadsheet whose columns and rows are defined before content is placed. Template properties (grid-template-columns/rows) set the container's blueprint, grid-row/grid-column place individual children, and grid-auto-rows/columns size tracks for unplanned content. The key idea is positioning by numbered grid lines rather than by row or column, using the start/end slash syntax (e.g. grid-row: 1/3). A worked example also shows that auto-placement gives explicitly positioned items priority, so a spanning item may need an explicit column to stay where it belongs.

  • Item Flow, Part 1: A new unified concept for layout

    WebKit mediumAdept

    Item Flow was a proposed unified CSS property system (shorthand `item-flow` with longhands `item-direction`, `item-wrap`, `item-pack`, `item-slack`) that would replace `flex-flow` and `grid-auto-flow` across Flexbox, Grid and masonry layouts. It would enable new capabilities such as `nowrap` for Grid, dense and balanced packing for Flexbox, a slack threshold for cramming items, and `item-pack: collapse` as the masonry trigger. A January 2026 update notes the CSSWG abandoned Item Flow in favor of CSS Grid Lanes for masonry, though balanced wrapping and similar ideas are still being discussed for Flexbox and Grid.

  • Subgrid: how to line up elements to your heart’s content

    WebKit mediumAdept

    CSS subgrid lets nested grid items adopt the row or column tracks defined on a parent grid, so content inside sibling cards stays aligned even when one card has longer text. A pricing-page walkthrough shows the three steps: make each card a grid, set grid-template-rows: subgrid, define matching rows on the parent (grid-template-rows: repeat(4, auto)), and have each card span them with grid-row: span 4. Skipping the span collapses all card content onto one row. Subgrid is supported across major browsers and safe to use.

The quest for software engineering knowledge.

Look:
Layout: