Package-level declarations

Types

Link copied to clipboard
data class PopupMenuAppearance(val colors: PopupMenuColors, val elevation: Dp = 3.dp, val shape: Shape = RoundedCornerShape(8.dp), val containerHorizontalPadding: Dp = 8.dp, val animationDuration: Int = 500)

Controls the appearance of the popup menu.

Link copied to clipboard
data class PopupMenuColors(val backgroundColor: Color, val foregroundColor: Color)

The colors of the popup menu

Link copied to clipboard
interface PopupMenuItem

A menu item for a popup menu.

Link copied to clipboard
data class PopupMenuItemImpl(val text: String, val action: () -> Unit) : PopupMenuItem

Implementation of PopupMenuItem that works with a String

Link copied to clipboard
data class PopupMenuItemResImpl(val context: Context, @StringRes val textId: Int, val action: () -> Unit) : PopupMenuItem

Implementation of PopupMenuItem that uses a string resource for the text

Link copied to clipboard
data class PopupMenuState(val showPopup: Boolean = false, lastPress: Offset = Offset.Zero, val items: List<PopupMenuItem> = emptyList())

The state of the popup menu. Controls if, where and what items are shown in the popup menu. The bottom border of the Popup will be centered on the offset (as far as this is possible with keeping it within the bounds of the parent container).

Functions

Link copied to clipboard
fun AnimatedPopup(modifier: Modifier = Modifier, properties: PopupProperties = PopupProperties(), expanded: Boolean, popupPositionProvider: PopupPositionProvider, onDismiss: () -> Unit? = null, enter: EnterTransition = fadeIn(), exit: ExitTransition = fadeOut(), content: @Composable AnimatedVisibilityScope.() -> Unit)

Animates the showing/hiding contents of a Popup

Link copied to clipboard
fun PopupMenu(popupMenuState: PopupMenuState, appearance: PopupMenuAppearance = PopupMenuAppearance.default(), onDismiss: () -> Unit = {})

A popup menu that can be shown at a given offset. The menu items are shown in a row, and if there are more items than can fit in the row, a "more" button is shown. When the "more" button is clicked, the remaining items are shown in a dropdown. The menu will not exceed the bounds of its parent container

Link copied to clipboard