# Compose by example: BoxWithConstraints

DevFeed: [Compose by example: BoxWithConstraints](<https://devfeed.tech/articles/compose-by-example-boxwithconstraints-22650.md>)

Original publisher: [Read original article](<https://www.valueof.io/blog/compose-boxwithconstraints-boxwithconstraintsscope>)

Author: james shvarts

Published: 2022-11-18T12:30:48Z

Content type: tutorial

Language: en

Sources: [Android Blog - Mobile Dev Notes](<https://devfeed.tech/sources/android-blog-mobile-dev-notes.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [Compose](<https://devfeed.tech/topics/compose.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [adaptive](<https://devfeed.tech/tags/adaptive.md>), [compose](<https://devfeed.tech/tags/compose.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [layout](<https://devfeed.tech/tags/layout.md>), [screen](<https://devfeed.tech/tags/screen.md>)

## AI overview

A practical tutorial on using BoxWithConstraints in Jetpack Compose to build responsive layouts. It demonstrates adapting a horizontal carousel to portrait and landscape modes by calculating card sizes from available constraints, and explains how BoxWithConstraints affects Compose phases.

## Source excerpt

A practical example of using BoxWithConstraints in Jetpack Compose to build responsive layouts