New Compose Multiplatform components arrived on Composables UICheck it out →

Component in Jetpack Glance

Scaffold

Android

A simple slot api component for displaying widget UI with a [TitleBar]. Sets the background color to GlanceTheme.colors.surface and applies padding. This is intended to be used as a top level component.

Last updated:

Installation

dependencies {
   implementation("androidx.glance:glance-appwidget:1.1.0")
}

Overloads

@Composable
fun Scaffold(
    modifier: GlanceModifier = GlanceModifier,
    titleBar: @Composable (() -> Unit)? = null,
    backgroundColor: ColorProvider = GlanceTheme.colors.widgetBackground,
    horizontalPadding: Dp = 12.dp,
    content: @Composable () -> Unit,
)

Parameters

namedescription
modifiera modifier
titleBarA composable that creates the [TitleBar]. Optional parameter.
backgroundColorthe background color for the layout.
horizontalPaddingScaffold provides a default padding which should work for most use cases. However, it can be overridden.
contentThe main content of the widget.