StylishDropdownMenu

fun StylishDropdownMenu(expanded: Boolean, onDismissRequest: () -> Unit, modifier: Modifier = Modifier, offset: DpOffset = DpOffset.Zero, properties: PopupProperties = PopupProperties(focusable = true), shape: Shape = MaterialTheme.shapes.extraSmall, containerColor: Color = MaterialTheme.colorScheme.surfaceContainer, content: @Composable ColumnScope.() -> Unit)

A dropdown menu that shows a list of choices on a temporary surface, wrapping the Material 3 DropdownMenu with Stylish defaults.

Populate the menu with StylishDropdownMenuItem (or any other content) and anchor it to a trigger by placing both inside the same composable. Control expanded and dismiss via onDismissRequest; the typical pattern is to dismiss when the anchor is tapped again, an item is selected, or the user taps outside.

Parameters

expanded

Whether the menu is currently shown.

onDismissRequest

Called when the user requests dismissal, such as by tapping outside the menu bounds.

modifier

Modifier applied to the menu content.

offset

DpOffset from the original position of the menu. Defaults to DpOffset.Zero.

properties

PopupProperties for further customization of the popup behavior. Defaults to a focusable popup.

shape

Shape of the menu surface. Defaults to MaterialTheme.shapes.extraSmall.

containerColor

Background color of the menu. Defaults to MaterialTheme.colorScheme.surfaceContainer.

content

The menu content, typically one or more StylishDropdownMenuItems, laid out in a ColumnScope.

See also