We just launched Compose Examples featuring over 150+ components! Check it out →

TitleBar

Android

Component in Jetpack Glance

A Title Bar. Contains an Icon, Text, and actions. Intended to be placed at the top of a widget.

Last updated:

Installation

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

Overloads

@SuppressLint("ComposableLambdaParameterNaming")
@Composable
fun TitleBar(
    startIcon: ImageProvider,
    title: String,
    iconColor: ColorProvider? = GlanceTheme.colors.onSurface,
    textColor: ColorProvider = GlanceTheme.colors.onSurface,
    modifier: GlanceModifier = GlanceModifier,
    fontFamily: FontFamily? = null,
    actions: @Composable RowScope.() -> Unit = {},
)

Parameters

namedescription
startIconA tintable icon representing your app or brand.
titleText to be displayed. Generally the name of your widget or app. Titleshould be shortened or omitted when the widget's width is narrow. The width can be checkedusing LocalSize.current.width
iconColorThe color which [startIcon] will be tinted.
textColorThe color which [title] will be tinted.
modifierGlanceModifier.
fontFamilyOptional override for [title]'s font family. Leave null to use the default.
actionsA slot api for buttons. Use [CircleIconButton] with backgroundColor = null.Buttons will be placed in a [Row].
by @alexstyl