Scaffold

fun Scaffold(modifier: Modifier = Modifier, topBar: @Composable () -> Unit = {}, bottomBar: @Composable () -> Unit = {}, floatingActionButton: @Composable () -> Unit = {}, floatingActionButtonPosition: FabPosition = FabPosition.End, floatingToolbar: @Composable () -> Unit = {}, floatingToolbarPosition: ToolbarPosition = ToolbarPosition.BottomCenter, snackbarHost: @Composable () -> Unit = {}, popupHost: @Composable () -> Unit = { MiuixPopupHost() }, containerColor: Color = MiuixTheme.colorScheme.surface, contentWindowInsets: WindowInsets = WindowInsets.systemBars.union(WindowInsets.displayCutout), content: @Composable (PaddingValues) -> Unit)

A Scaffold component with Miuix style.

This implements the basic miuix design visual layout structure.

To show a Snackbar, use SnackbarHostState.showSnackbar.

Parameters

modifier

the Modifier to be applied to this scaffold.

topBar

top app bar of the screen.

bottomBar

bottom bar of the screen.

floatingActionButton

floating action button of the screen.

floatingActionButtonPosition

position of the floating action button.

floatingToolbar

floating toolbar of the screen.

floatingToolbarPosition

position of the floating toolbar.

snackbarHost

component to host Snackbars that are pushed to be shown via SnackbarHostState.showSnackbar, typically a SnackbarHost.

popupHost

component to host overlay dropdowns &OverlayDialogs that are pushed to be show, typically a MiuixPopupHost.

containerColor

the color used for the background of this scaffold. Use Color.Transparent to have no color.

contentWindowInsets

window insets to be passed to content slot via PaddingValues params. Scaffold will take the insets into account from the top/bottom only if the topBar/ bottomBar are not present, as the scaffold expect topBar/bottomBar to handle insets instead. Any insets consumed by other insets padding modifiers or consumeWindowInsets on a parent layout will be excluded from contentWindowInsets.

content

content of the screen. The lambda receives a PaddingValues that should be applied to the content root via Modifier.padding and Modifier.consumeWindowInsets to properly offset top and bottom bars. If using Modifier.verticalScroll, apply this modifier to the child of the scroll, and not on the scroll itself.