HorizontalFloatingToolbarWithFabOverrideScope


Parameters available to the HorizontalFloatingToolbar that includes a Floating Action Button.

Summary

Public properties

FiniteAnimationSpec<Float>

the animation spec to use for this floating toolbar expand and collapse animation.

Cmn
Dp

the elevation for the shadow below this floating toolbar when collapsed.

Cmn
FloatingToolbarColors

the colors used for this floating toolbar.

Cmn
@Composable RowScope.() -> Unit

the main content of this floating toolbar.

Cmn
PaddingValues

the padding applied to the content of this floating toolbar.

Cmn
Dp

the elevation for the shadow below this floating toolbar when expanded.

Cmn
@Composable () -> Unit

a floating action button to be displayed by the toolbar.

Cmn
FloatingToolbarHorizontalFabPosition

the position of the floating toolbar's floating action button.

Cmn
Boolean

whether the floating toolbar is expanded or not.

Cmn
Modifier

the Modifier to be applied to this floating toolbar.

Cmn
FloatingToolbarScrollBehavior?

a FloatingToolbarScrollBehavior.

Cmn
Shape

the shape used for this floating toolbar content.

Cmn

Public properties

animationSpec

val animationSpecFiniteAnimationSpec<Float>

the animation spec to use for this floating toolbar expand and collapse animation.

collapsedShadowElevation

val collapsedShadowElevationDp

the elevation for the shadow below this floating toolbar when collapsed.

colors

val colorsFloatingToolbarColors

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.

content

val content: @Composable RowScope.() -> Unit

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

contentPadding

val contentPaddingPaddingValues

the padding applied to the content of this floating toolbar.

expandedShadowElevation

val expandedShadowElevationDp

the elevation for the shadow below this floating toolbar when expanded.

floatingActionButton

val 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.

floatingActionButtonPosition

val floatingActionButtonPositionFloatingToolbarHorizontalFabPosition

the position of the floating toolbar's floating action button. By default, the FAB is placed at the end of the toolbar (i.e. aligned to the right in left-to-right layout, or to the left in right-to-left layout).

isExpanded

val isExpandedBoolean

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

modifier

val modifierModifier

the Modifier to be applied to this floating toolbar.

scrollBehavior

val scrollBehaviorFloatingToolbarScrollBehavior?

a FloatingToolbarScrollBehavior. If provided, this FloatingToolbar will automatically react to scrolling. If your toolbar is positioned along a center edge of the screen (like top or bottom center), it's best to use this scroll behavior to make the entire toolbar scroll off-screen as the user scrolls. This would prevent the FAB from appearing off-center, which may occur in this case when using the isExpanded flag to simply expand or collapse the toolbar. Note that the toolbar will not react to scrolling in case a touch exploration service (e.g., TalkBack) is active.

shape

val shapeShape

the shape used for this floating toolbar content.