androidx.compose.material3

FloatingActionButtonDefaults

Object

No hand-written docs yet.

Contains the default values used by FloatingActionButton

object FloatingActionButtonDefaults

Properties

MediumIconSizeSince 1.10

val MediumIconSize: Dp

The recommended size of the icon inside a MediumFloatingActionButton.

LargeIconSize

val LargeIconSize: Dp

The recommended size of the icon inside a LargeFloatingActionButton.

shape

@Composable val shape: Shape

Default shape for a floating action button.

smallShape

@Composable val smallShape: Shape

Default shape for a small floating action button.

mediumShapeSince 1.10

@Composable val mediumShape: Shape

Default shape for a medium floating action button.

largeShape

@Composable val largeShape: Shape

Default shape for a large floating action button.

extendedFabShape

@Composable val extendedFabShape: Shape

Default shape for an extended floating action button.

smallExtendedFabShapeSince 1.10

@Composable val smallExtendedFabShape: Shape

Default shape for a small extended floating action button.

mediumExtendedFabShapeSince 1.10

@Composable val mediumExtendedFabShape: Shape

Default shape for a medium extended floating action button.

largeExtendedFabShapeSince 1.10

@Composable val largeExtendedFabShape: Shape

Default shape for a large extended floating action button.

containerColor

@Composable val containerColor: Color

Default container color for a floating action button.

Functions

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.

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.

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.

Library docs

Contains the default values used by FloatingActionButton