AdaptiveTheme

fun AdaptiveTheme(formFactor: FormFactor = rememberFormFactor(), content: @Composable () -> Unit)

Provides AdaptiveTokens for the current surface. Wrap the app shell once, then read LocalAdaptiveTokens.current.screenPadding anywhere below.

formFactor is detected from the platform by default (rememberFormFactor); pass it explicitly to force a surface — useful for previews, screenshot tests, and a desktop build that renders a TV UI.

Width comes from the container, not the window, so nesting works: a detail pane inside a two-pane layout resolves to Compact even on an Expanded window, which is what you want.


fun AdaptiveTheme(formFactor: FormFactor, windowType: WindowType, content: @Composable () -> Unit)

Escape hatch for consumers that already resolve a window size class upstream (Android currentWindowAdaptiveInfo(), a desktop window listener) and don't want a second BoxWithConstraints subcomposition at the root.