UX4G Logo
Components

App Header

Configurable top navigation app bar supporting official emblems, logos, title, trailing actions, and profile avatars

Configurable top navigation app bar supporting official emblems, logos, title, trailing actions, and profile avatars.

Import from com.ux4g.designsystemv1.components.Ux4gAppHeader.


Interactive Preview

Ux4gAppHeaderJetpack Compose
UX4G App Header Preview

Kotlin Usage

Compose Example
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.ux4g.designsystemv1.components.Ux4gAppHeader
import com.ux4g.designsystemv1.components.Ux4gAppHeaderVariant
import com.ux4g.designsystemv1.components.Ux4gAppHeaderAction
import com.ux4g.designsystemv1.foundation.Ux4gIcons

@Composable
fun AppHeaderExample() {
    Ux4gAppHeader(
        title = "Dashboard",
        variant = Ux4gAppHeaderVariant.Filled,
        showBackButton = true,
        onBackPressed = { /* Navigate back */ },
        actions = listOf(
            Ux4gAppHeaderAction(icon = Ux4gIcons.Settings, onClick = { /* Settings */ })
        )
    )
}

Parameters

Ux4gAppHeader Props

PropTypeDescriptionDefault
title *StringPrimary header title text.""
modifierModifierCompose layout modifier applied to header container.Modifier
variantUx4gAppHeaderVariantVisual style variant: Light, Filled, or Outlined.Outlined
showBackButtonBooleanWhether to show back button as leading widget (overrides leading items).false
onBackPressed(() -> Unit)?Callback triggered when back button is tapped.null
leadingWidgetsList<@Composable () -> Unit>?List of custom leading widgets (emblems, logos, dividers).null
leadingContent(@Composable () -> Unit)?Single custom leading composable slot.null
actionsList<Ux4gAppHeaderAction>List of trailing action icon buttons or custom action widgets.emptyList()
avatar(@Composable () -> Unit)?Custom avatar composable slot at trailing end.null
avatarSizeUx4gAvatarSizeAvatar dimension size when showAvatar = true.Ux4gAvatarSize.Medium
showAvatarBooleanWhether to render default Ux4gAvatar at trailing end.false
avatarImageUrlString?Image URL for default profile avatar.null
avatarInitialsString?Initials fallback text when avatar image is absent.null
onAvatarClick(() -> Unit)?Click callback for trailing avatar.null
titleWidget(@Composable () -> Unit)?Custom composable slot for title (overrides title string).null
useSafeAreaBooleanApplies status bar inset padding automatically.true
heightDpHeight dimension of header bar.56.dp
backgroundColorColor?Custom background color override.null
contentColorColor?Custom text and icon color override.null
borderColorColor?Border color for Outlined variant.null

Ux4gAppHeaderAction Model

PropTypeDescriptionDefault
iconUx4gIcon?Vector icon resource for action button.Ux4gIcons.Settings
onClick(() -> Unit)?Click handler callback when action is pressed.null
tooltipString?Accessibility label / tooltip description.null
customWidget(@Composable () -> Unit)?Custom composable slot replacing standard icon button.null

Ux4gAppHeaderVariant Enum

ValueDescription
LightSurface background with dark text, emblem, and action icons.
FilledPrimary purple solid background with high-contrast white text and icons.
OutlinedSurface background with subtle bottom border line.

On this page