VerticalFloatingToolbar

Functions summary

Unit
@ExperimentalMaterial3ExpressiveApi
@ExperimentalMaterial3XrApi
@Composable
VerticalFloatingToolbar(
    expanded: Boolean,
    modifier: Modifier,
    colors: FloatingToolbarColors,
    contentPadding: PaddingValues,
    scrollBehavior: FloatingToolbarScrollBehavior?,
    leadingContent: (@Composable ColumnScope.() -> Unit)?,
    trailingContent: (@Composable ColumnScope.() -> Unit)?,
    content: @Composable ColumnScope.() -> Unit
)

XR-specific Vertical Floating Toolbar that displays content in a Column in an end-aligned VerticalOrbiter.

Unit
@ExperimentalMaterial3ExpressiveApi
@ExperimentalMaterial3XrApi
@Composable
VerticalFloatingToolbar(
    expanded: Boolean,
    floatingActionButton: @Composable () -> Unit,
    modifier: Modifier,
    colors: FloatingToolbarColors,
    contentPadding: PaddingValues,
    scrollBehavior: FloatingToolbarScrollBehavior?,
    shape: Shape,
    floatingActionButtonPosition: FloatingToolbarVerticalFabPosition,
    content: @Composable ColumnScope.() -> Unit
)

XR-specific Vertical Floating Toolbar that displays content in a Column in an end-aligned VerticalOrbiter alongside an adjacent floating action button.

Functions

VerticalFloatingToolbar

@ExperimentalMaterial3ExpressiveApi
@ExperimentalMaterial3XrApi
@Composable
fun VerticalFloatingToolbar(
    expanded: Boolean,
    modifier: Modifier = Modifier,
    colors: FloatingToolbarColors = FloatingToolbarDefaults.standardFloatingToolbarColors(),
    contentPadding: PaddingValues = FloatingToolbarDefaults.ContentPadding,
    scrollBehavior: FloatingToolbarScrollBehavior? = null,
    leadingContent: (@Composable ColumnScope.() -> Unit)? = null,
    trailingContent: (@Composable ColumnScope.() -> Unit)? = null,
    content: @Composable ColumnScope.() -> Unit
): Unit

XR-specific Vertical Floating Toolbar that displays content in a Column in an end-aligned VerticalOrbiter.

Note: This component will stay expanded to maintain the toolbar visibility for users with touch exploration services enabled (e.g., TalkBack).

Parameters
expanded: Boolean

whether the FloatingToolbar is in expanded mode, i.e. showing leadingContent and trailingContent. Note that the toolbar will stay expanded in case a touch exploration service (e.g., TalkBack) is active.

modifier: Modifier = Modifier

the Modifier to be applied to this FloatingToolbar.

colors: FloatingToolbarColors = FloatingToolbarDefaults.standardFloatingToolbarColors()

the colors used for this floating toolbar. There are two predefined FloatingToolbarColors at FloatingToolbarDefaults.standardFloatingToolbarColors and FloatingToolbarDefaults.vibrantFloatingToolbarColors which you can use or modify.

contentPadding: PaddingValues = FloatingToolbarDefaults.ContentPadding

the padding applied to the content of this FloatingToolbar.

scrollBehavior: FloatingToolbarScrollBehavior? = null

a FloatingToolbarScrollBehavior. If null, this FloatingToolbar will not automatically react to scrolling. Note that the toolbar will not react to scrolling in case a touch exploration service (e.g., TalkBack) is active.

leadingContent: (@Composable ColumnScope.() -> Unit)? = null

the leading content of this FloatingToolbar. The default layout here is a Column, so content inside will be placed vertically. Only showing if expanded is true.

trailingContent: (@Composable ColumnScope.() -> Unit)? = null

the trailing content of this FloatingToolbar. The default layout here is a Column, so content inside will be placed vertically. Only showing if expanded is true.

content: @Composable ColumnScope.() -> Unit

the main content of this FloatingToolbar. The default layout here is a Column, so content inside will be placed vertically.

VerticalFloatingToolbar

@ExperimentalMaterial3ExpressiveApi
@ExperimentalMaterial3XrApi
@Composable
fun VerticalFloatingToolbar(
    expanded: Boolean,
    floatingActionButton: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    colors: FloatingToolbarColors = FloatingToolbarDefaults.standardFloatingToolbarColors(),
    contentPadding: PaddingValues = FloatingToolbarDefaults.ContentPadding,
    scrollBehavior: FloatingToolbarScrollBehavior? = null,
    shape: Shape = FloatingToolbarDefaults.ContainerShape,
    floatingActionButtonPosition: FloatingToolbarVerticalFabPosition = FloatingToolbarVerticalFabPosition.Bottom,
    content: @Composable ColumnScope.() -> Unit
): Unit

XR-specific Vertical Floating Toolbar that displays content in a Column in an end-aligned VerticalOrbiter alongside an adjacent floating action button.

Note: This component will stay expanded to maintain the toolbar visibility for users with touch exploration services enabled (e.g., TalkBack).

Parameters
expanded: Boolean

whether the floating toolbar is expanded or not. In its expanded state, the FAB and the toolbar content are organized vertically. Otherwise, only the FAB is visible. Note that the toolbar will stay expanded in case a touch exploration service (e.g., TalkBack) is active.

floatingActionButton: @Composable () -> Unit

a floating action button to be displayed by the toolbar. It's recommended to use a FloatingToolbarDefaults.VibrantFloatingActionButton or FloatingToolbarDefaults.StandardFloatingActionButton that is styled to match the colors. Note that the provided FAB's size is controlled by the floating toolbar and animates according to its state. In case a custom FAB is provided, make sure it's set with a Modifier.fillMaxSize to be sized correctly.

modifier: Modifier = Modifier

the Modifier to be applied to this floating toolbar.

colors: FloatingToolbarColors = FloatingToolbarDefaults.standardFloatingToolbarColors()

the colors used for this floating toolbar. There are two predefined FloatingToolbarColors at FloatingToolbarDefaults.standardFloatingToolbarColors and FloatingToolbarDefaults.vibrantFloatingToolbarColors which you can use or modify. See also floatingActionButton for more information on the right FAB to use for proper styling.

contentPadding: PaddingValues = FloatingToolbarDefaults.ContentPadding

the padding applied to the content of this floating toolbar.

scrollBehavior: FloatingToolbarScrollBehavior? = null

a FloatingToolbarScrollBehavior. If provided, this FloatingToolbar will automatically react to scrolling.

shape: Shape = FloatingToolbarDefaults.ContainerShape

the shape used for this floating toolbar content.

floatingActionButtonPosition: FloatingToolbarVerticalFabPosition = FloatingToolbarVerticalFabPosition.Bottom

the position of the floating toolbar's floating action button. By default, the FAB is placed at the bottom of the toolbar (i.e. aligned to the bottom).

content: @Composable ColumnScope.() -> Unit

the main content of this floating toolbar. The default layout here is a Column, so content inside will be placed vertically.