FloatingActionButtonDefaults


Contains the default values used by FloatingActionButton

Summary

Public functions

FloatingActionButtonElevation
bottomAppBarFabElevation(
    defaultElevation: Dp,
    pressedElevation: Dp,
    focusedElevation: Dp,
    hoveredElevation: Dp
)

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

Cmn
FloatingActionButtonElevation
@Composable
elevation(
    defaultElevation: Dp,
    pressedElevation: Dp,
    focusedElevation: Dp,
    hoveredElevation: Dp
)

Creates a FloatingActionButtonElevation that represents the elevation of a FloatingActionButton in different states.

Cmn
FloatingActionButtonElevation
@Composable
loweredElevation(
    defaultElevation: Dp,
    pressedElevation: Dp,
    focusedElevation: Dp,
    hoveredElevation: Dp
)

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

Cmn

Public properties

Dp

The recommended size of the icon inside a LargeFloatingActionButton.

Cmn
Color

Default container color for a floating action button.

Cmn
Shape

Default shape for an extended floating action button.

Cmn
Shape

Default shape for a large floating action button.

Cmn
Shape

Default shape for a floating action button.

Cmn
Shape

Default shape for a small floating action button.

Cmn

Public functions

bottomAppBarFabElevation

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: Dp = 0.dp

the elevation used when the FloatingActionButton has no other Interactions.

pressedElevation: Dp = 0.dp

the elevation used when the FloatingActionButton is pressed.

focusedElevation: Dp = 0.dp

the elevation used when the FloatingActionButton is focused.

hoveredElevation: Dp = 0.dp

the elevation used when the FloatingActionButton is hovered.

elevation

@Composable
fun elevation(
    defaultElevation: Dp = FabPrimaryTokens.ContainerElevation,
    pressedElevation: Dp = FabPrimaryTokens.PressedContainerElevation,
    focusedElevation: Dp = FabPrimaryTokens.FocusContainerElevation,
    hoveredElevation: Dp = FabPrimaryTokens.HoverContainerElevation
): 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: Dp = FabPrimaryTokens.ContainerElevation

the elevation used when the FloatingActionButton has no other Interactions.

pressedElevation: Dp = FabPrimaryTokens.PressedContainerElevation

the elevation used when the FloatingActionButton is pressed.

focusedElevation: Dp = FabPrimaryTokens.FocusContainerElevation

the elevation used when the FloatingActionButton is focused.

hoveredElevation: Dp = FabPrimaryTokens.HoverContainerElevation

the elevation used when the FloatingActionButton is hovered.

loweredElevation

@Composable
fun loweredElevation(
    defaultElevation: Dp = FabPrimaryTokens.LoweredContainerElevation,
    pressedElevation: Dp = FabPrimaryTokens.LoweredPressedContainerElevation,
    focusedElevation: Dp = FabPrimaryTokens.LoweredFocusContainerElevation,
    hoveredElevation: Dp = FabPrimaryTokens.LoweredHoverContainerElevation
): FloatingActionButtonElevation

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

Parameters
defaultElevation: Dp = FabPrimaryTokens.LoweredContainerElevation

the elevation used when the FloatingActionButton has no other Interactions.

pressedElevation: Dp = FabPrimaryTokens.LoweredPressedContainerElevation

the elevation used when the FloatingActionButton is pressed.

focusedElevation: Dp = FabPrimaryTokens.LoweredFocusContainerElevation

the elevation used when the FloatingActionButton is focused.

hoveredElevation: Dp = FabPrimaryTokens.LoweredHoverContainerElevation

the elevation used when the FloatingActionButton is hovered.

Public properties

LargeIconSize

val LargeIconSizeDp

The recommended size of the icon inside a LargeFloatingActionButton.

containerColor

val containerColorColor

Default container color for a floating action button.

extendedFabShape

val extendedFabShapeShape

Default shape for an extended floating action button.

largeShape

val largeShapeShape

Default shape for a large floating action button.

shape

val shapeShape

Default shape for a floating action button.

smallShape

val smallShapeShape

Default shape for a small floating action button.