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
Dp

The recommended size of the icon inside a MediumFloatingActionButton.

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 extended floating action button.

Cmn
Shape

Default shape for a large floating action button.

Cmn
Shape

Default shape for a medium extended floating action button.

Cmn
Shape

Default shape for a medium floating action button.

Cmn
Shape

Default shape for a floating action button.

Cmn
Shape

Default shape for a small extended 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 = 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: Dp = FabPrimaryContainerTokens.ContainerElevation

the elevation used when the FloatingActionButton has no other Interactions.

pressedElevation: Dp = FabPrimaryContainerTokens.PressedContainerElevation

the elevation used when the FloatingActionButton is pressed.

focusedElevation: Dp = FabPrimaryContainerTokens.FocusedContainerElevation

the elevation used when the FloatingActionButton is focused.

hoveredElevation: Dp = FabPrimaryContainerTokens.HoveredContainerElevation

the elevation used when the FloatingActionButton is hovered.

loweredElevation

@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: Dp = ElevationTokens.Level1

the elevation used when the FloatingActionButton has no other Interactions.

pressedElevation: Dp = ElevationTokens.Level1

the elevation used when the FloatingActionButton is pressed.

focusedElevation: Dp = ElevationTokens.Level1

the elevation used when the FloatingActionButton is focused.

hoveredElevation: Dp = ElevationTokens.Level2

the elevation used when the FloatingActionButton is hovered.

Public properties

LargeIconSize

val LargeIconSizeDp

The recommended size of the icon inside a LargeFloatingActionButton.

MediumIconSize

@ExperimentalMaterial3ExpressiveApi
val MediumIconSizeDp

The recommended size of the icon inside a MediumFloatingActionButton.

containerColor

val containerColorColor

Default container color for a floating action button.

extendedFabShape

val extendedFabShapeShape

Default shape for an extended floating action button.

largeExtendedFabShape

@ExperimentalMaterial3ExpressiveApi
val largeExtendedFabShapeShape

Default shape for a large extended floating action button.

largeShape

val largeShapeShape

Default shape for a large floating action button.

mediumExtendedFabShape

@ExperimentalMaterial3ExpressiveApi
val mediumExtendedFabShapeShape

Default shape for a medium extended floating action button.

mediumShape

@ExperimentalMaterial3ExpressiveApi
val mediumShapeShape

Default shape for a medium floating action button.

shape

val shapeShape

Default shape for a floating action button.

smallExtendedFabShape

@ExperimentalMaterial3ExpressiveApi
val smallExtendedFabShapeShape

Default shape for a small extended floating action button.

smallShape

val smallShapeShape

Default shape for a small floating action button.