Object

FloatingActionButtonDefaults

Contains the default values used by FloatingActionButton

Source set: Common

Added in 1.5.0-alpha17

object FloatingActionButtonDefaults

Contains the default values used by FloatingActionButton

Properties

MediumIconSize

Source set: Common

Added in 1.5.0-alpha17

@ExperimentalMaterial3ExpressiveApi val MediumIconSize = FabMediumTokens.IconSize

The recommended size of the icon inside a MediumFloatingActionButton.

LargeIconSize

Source set: Common

Added in 1.5.0-alpha17

val LargeIconSize = 36.dp // TODO: FabLargeTokens.IconSize is incorrect

The recommended size of the icon inside a LargeFloatingActionButton.

shape

Source set: Common

Added in 1.5.0-alpha17

val shape: Shape

Default shape for a floating action button.

smallShape

Source set: Common

Added in 1.5.0-alpha17

val smallShape: Shape

Default shape for a small floating action button.

mediumShape

Source set: Common

Added in 1.5.0-alpha17

@ExperimentalMaterial3ExpressiveApi
val mediumShape: Shape

Default shape for a medium floating action button.

largeShape

Source set: Common

Added in 1.5.0-alpha17

val largeShape: Shape

Default shape for a large floating action button.

extendedFabShape

Source set: Common

Added in 1.5.0-alpha17

val extendedFabShape: Shape

Default shape for an extended floating action button.

smallExtendedFabShape

Source set: Common

Added in 1.5.0-alpha17

@ExperimentalMaterial3ExpressiveApi
val smallExtendedFabShape: Shape

Default shape for a small extended floating action button.

mediumExtendedFabShape

Source set: Common

Added in 1.5.0-alpha17

@ExperimentalMaterial3ExpressiveApi
val mediumExtendedFabShape: Shape

Default shape for a medium extended floating action button.

largeExtendedFabShape

Source set: Common

Added in 1.5.0-alpha17

@ExperimentalMaterial3ExpressiveApi
val largeExtendedFabShape: Shape

Default shape for a large extended floating action button.

containerColor

Source set: Common

Added in 1.5.0-alpha17

val containerColor: Color

Default container color for a floating action button.

Functions

elevation

Added in 1.5.0-alpha17

@Composable
    fun elevation(
        defaultElevation: Dp = FabPrimaryContainerTokens.ContainerElevation,
        pressedElevation: Dp = FabPrimaryContainerTokens.PressedContainerElevation,
        focusedElevation: Dp = FabPrimaryContainerTokens.FocusedContainerElevation,
        hoveredElevation: Dp = FabPrimaryContainerTokens.HoveredContainerElevation,
    ): FloatingActionButtonElevation

Creates a FloatingActionButtonElevation that represents the elevation of a FloatingActionButton in different states. For use cases in which a less prominent FloatingActionButton is possible consider the loweredElevation.

Parameters

defaultElevation the elevation used when the FloatingActionButton has no other Interactions.
pressedElevation the elevation used when the FloatingActionButton is pressed.
focusedElevation the elevation used when the FloatingActionButton is focused.
hoveredElevation the elevation used when the FloatingActionButton is hovered.

loweredElevation

Added in 1.5.0-alpha17

@Composable
    fun loweredElevation(
        defaultElevation: Dp = ElevationTokens.Level1,
        pressedElevation: Dp = ElevationTokens.Level1,
        focusedElevation: Dp = ElevationTokens.Level1,
        hoveredElevation: Dp = ElevationTokens.Level2,
    ): FloatingActionButtonElevation

Use this to create a FloatingActionButton with a lowered elevation for less emphasis. Use elevation to get a normal FloatingActionButton.

Parameters

defaultElevation the elevation used when the FloatingActionButton has no other Interactions.
pressedElevation the elevation used when the FloatingActionButton is pressed.
focusedElevation the elevation used when the FloatingActionButton is focused.
hoveredElevation the elevation used when the FloatingActionButton is hovered.

bottomAppBarFabElevation

Added in 1.5.0-alpha17

fun bottomAppBarFabElevation(
        defaultElevation: Dp = 0.dp,
        pressedElevation: Dp = 0.dp,
        focusedElevation: Dp = 0.dp,
        hoveredElevation: Dp = 0.dp,
    ): FloatingActionButtonElevation

Use this to create a FloatingActionButton that represents the default elevation of a FloatingActionButton used for BottomAppBar in different states.

Parameters

defaultElevation the elevation used when the FloatingActionButton has no other Interactions.
pressedElevation the elevation used when the FloatingActionButton is pressed.
focusedElevation the elevation used when the FloatingActionButton is focused.
hoveredElevation the elevation used when the FloatingActionButton is hovered.