object FloatingActionButtonDefaults
Contains the default values used by FloatingActionButton
Properties
@ExperimentalMaterial3ExpressiveApi val MediumIconSize = FabMediumTokens.IconSize
The recommended size of the icon inside a MediumFloatingActionButton.
val LargeIconSize = 36.dp // TODO: FabLargeTokens.IconSize is incorrect
The recommended size of the icon inside a LargeFloatingActionButton.
val shape: Shape
Default shape for a floating action button.
val smallShape: Shape
Default shape for a small floating action button.
@ExperimentalMaterial3ExpressiveApi
val mediumShape: Shape
Default shape for a medium floating action button.
val largeShape: Shape
Default shape for a large floating action button.
val extendedFabShape: Shape
Default shape for an extended floating action button.
@ExperimentalMaterial3ExpressiveApi
val smallExtendedFabShape: Shape
Default shape for a small extended floating action button.
@ExperimentalMaterial3ExpressiveApi
val mediumExtendedFabShape: Shape
Default shape for a medium extended floating action button.
@ExperimentalMaterial3ExpressiveApi
val largeExtendedFabShape: Shape
Default shape for a large extended floating action button.
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.
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
@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
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. |