AppBarScope

Interface

Common
sealed interface AppBarScope

DSL scope for building the content of an AppBarRow and AppBarColumn.

Functions

fun clickableItem(
        onClick: () -> Unit,
        icon: @Composable () -> Unit,
        label: String,
        enabled: Boolean = true,
    )

Adds a clickable item to the AppBarRow or AppBarColumn.

Parameters

onClickThe action to perform when the item is clicked.
iconThe composable representing the item's icon.
enabledWhether the item is enabled.
labelThe text label for the item, used in the overflow menu.
fun toggleableItem(
        checked: Boolean,
        onCheckedChange: (Boolean) -> Unit,
        icon: @Composable () -> Unit,
        label: String,
        enabled: Boolean = true,
    )

Adds a toggleable item to the AppBarRow or AppBarColumn.

Parameters

checkedWhether the item is currently checked.
onCheckedChangeThe action to perform when the item's checked state changes.
iconThe composable representing the item's icon.
enabledWhether the item is enabled.
labelThe text label for the item, used in the overflow menu.
fun customItem(
        appbarContent: @Composable () -> Unit,
        menuContent: @Composable (AppBarMenuState) -> Unit,
    )

Adds a custom item to the AppBarRow or AppBarColumn.

Parameters

appbarContentThe composable to display in the app bar.
menuContentThe composable to display in the overflow menu. It receives an AppBarMenuState instance.