AppBackground
The main background for the app. Uses LocalBackgroundTheme to set the color and tonal elevation of a Surface.
A theme-aware background component that wraps content with proper Material 3 theming. The background color and elevation adapt based on the provided theme values.
Features:
Automatic color from LocalBackgroundTheme
Tonal elevation support for depth
Resets absolute tonal elevation for nested surfaces
Fills max size by default
Usage Example:
@Composable
fun MyApp() {
AppBackground {
// Your app content
Scaffold(
topBar = { JetpackTopAppBar(...) },
content = { padding ->
MainContent(Modifier.padding(padding))
}
)
}
}Content copied to clipboard
Parameters
modifier
Modifier to be applied to the background.
content
The background content.
See also
For gradient backgrounds on specific screens
Theme provider for background customization