androidx.compose.material3

MenuDefaults

Object

No hand-written docs yet.

Contains default values used for DropdownMenu and DropdownMenuItem.

object MenuDefaults

Properties

TonalElevation

val TonalElevation: Dp

The default tonal elevation for a menu.

ShadowElevation

val ShadowElevation: Dp

The default shadow elevation for a menu.

LeadingIconSizeSince 1.11

val LeadingIconSize: Dp

The default leading icon size for a menu item.

TrailingIconSizeSince 1.11

val TrailingIconSize: Dp

The default trailing icon size for a menu item.

shape

@Composable val shape

The default shape for a menu.

containerColor

@Composable val containerColor

The default container color for a menu.

groupStandardContainerColorSince 1.11

@Composable val groupStandardContainerColor: Color

The standard default container color for a group within a menu.

groupVibrantContainerColorSince 1.11

@Composable val groupVibrantContainerColor: Color

The vibrant default container color for a group within a menu.

leadingGroupShapeSince 1.11

@Composable val leadingGroupShape: Shape

The default shape for the leading group of a menu.

middleGroupShapeSince 1.11

@Composable val middleGroupShape: Shape

The default shape for the middle group of a menu.

trailingGroupShapeSince 1.11

@Composable val trailingGroupShape: Shape

The default shape for the trailing group of a menu.

leadingItemShapeSince 1.11

@Composable val leadingItemShape: Shape

The default shape for the leading item of a menu or group.

middleItemShapeSince 1.11

@Composable val middleItemShape: Shape

The default shape for the middle item of a menu or group.

trailingItemShapeSince 1.11

@Composable val trailingItemShape: Shape

The default shape for the trailing item of a menu or group.

standaloneItemShapeSince 1.11

@Composable val standaloneItemShape: Shape

The default shape for a standalone item of a menu or group.

selectedItemShapeSince 1.11

@Composable val selectedItemShape: Shape

The selected shape for items of a group.

standaloneGroupShapeSince 1.11

@Composable val standaloneGroupShape: Shape

The default shape for a standalone group of a menu.

inactiveGroupShapeSince 1.11

@Composable val inactiveGroupShape: Shape

The shape for a group of a menu that is no longer being hovered.

GroupSpacingSince 1.11

val GroupSpacing: Dp

The default spacing between each menu group. Usually used in a Spacer's height

HorizontalDividerPaddingSince 1.11

val HorizontalDividerPadding: PaddingValues

The default padding for a HorizontalDivider used in a menu group. Use this padding value in a HorizontalDivider's padding modifier.

val DropdownMenuGroupLabelHorizontalPadding: PaddingValues

The default horizontal padding for a menu group label. Please see MenuDefaults.Label.

val DropdownMenuItemTrailingLabelHorizontalPadding: PaddingValues

The default horizontal padding for a menu group trailing label. Please see MenuDefaults.DropdownMenuItemTrailingLabel.

val DropdownMenuItemHorizontalArrangement: Arrangement.Horizontal

Default horizontal arrangement for a menu item.

val DropdownMenuItemContentPadding: PaddingValues

Default padding used for DropdownMenuItem.

val DropdownMenuSelectableItemContentPadding: PaddingValues

Default padding used for DropdownMenuItem that are selectable.

val DropdownMenuGroupContentPadding: PaddingValues

Default padding used for DropdownMenuGroup.

Functions

groupShapeSince 1.11

@Composable
fun groupShape(index: Int, count: Int): MenuGroupShapes

A MenuGroupShapes constructor that the group in index should have when there are count groups in the menu.

itemShapeSince 1.11

@Composable
fun itemShape(index: Int, count: Int): MenuItemShapes

A MenuItemShapes constructor that the item in index should have when there are count items in the menu or group. If a DropdownMenuGroup is used, please pass the number of items within the group as count. If no DropdownMenuGroup is used, please pass the number of items in the entire menu as count.

itemColors

@Composable
fun itemColors(): MenuItemColors

Creates a MenuItemColors that represents the default text and icon colors used in a DropdownMenuItemContent.

itemShapesSince 1.11

@Composable
fun itemShapes(
    shape: Shape? = null,
    selectedShape: Shape? = null,
): MenuItemShapes

Creates a MenuItemShapes that represents the shapes used in a toggleable or selectable DropdownMenuItem, allowing for overrides.

@Composable
fun itemShapes(): MenuItemShapes

Creates a MenuItemShapes that represents the shapes used in a toggleable or selectable DropdownMenuItem.

groupShapesSince 1.11

@Composable
fun groupShapes(
    shape: Shape? = null,
    inactiveShape: Shape? = null,
): MenuGroupShapes

Creates a MenuGroupShapes that represents the default shapes used in a DropdownMenuGroup, allowing for overrides.

@Composable
fun groupShapes(): MenuGroupShapes

Creates a MenuGroupShapes that represents the default shapes used in a DropdownMenuGroup.

LabelSince 1.11

@Composable
fun Label(
    contentAlignment: Alignment = Alignment.CenterStart,
    padding: PaddingValues = DropdownMenuGroupLabelHorizontalPadding,
    content: @Composable () -> Unit,
)

The default label recommended to be used within a DropdownMenuGroup.

@Composable
fun DropdownMenuItemTrailingLabel(
    padding: PaddingValues = DropdownMenuItemTrailingLabelHorizontalPadding,
    content: @Composable () -> Unit,
)

The default trailing label recommended to be used within a DropdownMenuItem which can be passed to its trailingIcon param.

@Composable
fun itemColors(
    textColor: Color = Color.Unspecified,
    leadingIconColor: Color = Color.Unspecified,
    trailingIconColor: Color = Color.Unspecified,
    disabledTextColor: Color = Color.Unspecified,
    disabledLeadingIconColor: Color = Color.Unspecified,
    disabledTrailingIconColor: Color = Color.Unspecified,
): MenuItemColors

Creates a MenuItemColors that represents the default text and icon colors used in a DropdownMenuItemContent.

selectableItemColorsSince 1.11

@Composable
fun selectableItemColors(
    textColor: Color = Color.Unspecified,
    containerColor: Color = Color.Unspecified,
    leadingIconColor: Color = Color.Unspecified,
    trailingIconColor: Color = Color.Unspecified,
    disabledTextColor: Color = Color.Unspecified,
    disabledLeadingIconColor: Color = Color.Unspecified,
    disabledTrailingIconColor: Color = Color.Unspecified,
    selectedContainerColor: Color = Color.Unspecified,
    selectedTextColor: Color = Color.Unspecified,
    selectedLeadingIconColor: Color = Color.Unspecified,
    selectedTrailingIconColor: Color = Color.Unspecified,
): MenuItemColors

Creates a MenuItemColors that represents the default text, icon, and container colors used in a standard color variant DropdownMenuItem.

selectableItemVibrantColorsSince 1.11

@Composable
fun selectableItemVibrantColors(
    textColor: Color = Color.Unspecified,
    containerColor: Color = Color.Unspecified,
    leadingIconColor: Color = Color.Unspecified,
    trailingIconColor: Color = Color.Unspecified,
    disabledTextColor: Color = Color.Unspecified,
    disabledLeadingIconColor: Color = Color.Unspecified,
    disabledTrailingIconColor: Color = Color.Unspecified,
    selectedContainerColor: Color = Color.Unspecified,
    selectedTextColor: Color = Color.Unspecified,
    selectedLeadingIconColor: Color = Color.Unspecified,
    selectedTrailingIconColor: Color = Color.Unspecified,
): MenuItemColors

Creates a MenuItemColors that represents the default text, icon, and container colors used in a vibrant color variant DropdownMenuItem.

rememberDropdownMenuPopupPositionProviderSince 1.12

@Composable
fun rememberDropdownMenuPopupPositionProvider(
    dropdownMenuAnchorPosition: MenuAnchorPosition,
    offset: DpOffset = DpOffset(0.dp, 0.dp),
): DropdownMenuPopupPositionProvider

Creates and remembers a DropdownMenuPopupPositionProvider that positions a dropdown menu relative to its anchor.

Library docs

Contains default values used for DropdownMenu and DropdownMenuItem.