← All posts
Compose20 August 20264 min read

Why I stopped writing custom Compose layouts

Three years of reaching for Layout when Row and Column would have done the job perfectly well.

I wrote my first custom Layout about a month into learning Compose. I have written maybe four since, and deleted three of them.

The pull is real

Layout gives you exact measurement and placement. When Row will not do the thing you want, reaching for it feels like the professional move.

Layout(content = content) { measurables, constraints ->
    val placeables = measurables.map { it.measure(constraints) }
    layout(constraints.maxWidth, placeables.maxOf { it.height }) {
        // ...and now you own this forever
    }
}

What it actually costs

You own intrinsics. You own the constraint edge cases. You own what happens when a child is zero-width, or when the parent passes unbounded constraints, or when someone drops it in a scrolling container.

The check I use now

Can Row, Column, or Box with weights and alignment get within a few pixels? If yes, ship that. Nobody has ever noticed the few pixels. They do notice when a custom layout crashes in an unbounded-height parent.

Where it is still right

Genuinely novel geometry — a radial menu, a puzzle grid that has to measure itself against its own content. Mathrid has exactly one, and it earns its keep.

Written by Sulton UzDev. Get new posts by email →

Sulton UzDev
Senior Android Developer · Kotlin, Compose & KMP · I build the app and its backend
© 2026 Sulton UzDevUzbekistanBlogProjectsAboutSubscribe