Skip to content

Overlays and dialogs ​

Use a menu for nearby commands, a dialog for a brief confirmation, and a Sheet for a temporary task with its own content.

Choose an overlay ​

ScenarioComponentBehavior
Actions, choices, or submenus near a triggerPopupActionMenuTakes structured items and caller-owned expanded state.
Select a value from a settings rowItemDropdownShows the selected value and opens PopupMenuItem choices.
Custom content in a menu surfacePopupMenuProvides a menu panel with caller-defined content.
General anchored contentPopupLets the caller define the content and anchor layout.
Modal confirmation or short taskDialogProvides a cross-platform dialog.
Mobile screen or desktop dialogAdaptiveDialogPicks a host for the platform.
Temporary task, selector, or formSheetSupports bottom and floating presentations, detents, and dismissal options.
Android-only bottom dialogBottomSheetDialogUses the Android host.
Separate desktop windowSaltDialogWindowCreates a native desktop window.

See Popup menus for selection, pointer placement, keyboard behavior, and backdrop setup.

Sheet and Scaffold ​

Sheet presents a modal task. BottomSheetScaffold integrates a bottom panel into the screen layout and exposes a nestedScrollConnection for coordinating panel and body scrolling.

kotlin
BottomSheetScaffold(
    sheetContent = {
        Text(text = "Panel content")
    }
) {
    Text(text = "Page content")
}

Backdrop material ​

Native overlays can have a different coordinate space. Use DisableMaterial and give the content a background if it needs an independent surface. Menus use PopupMenuBackdrop. Choose PopupMenuMaterial.Solid for an opaque menu.

Google/Android 是 Google LLC 的注册商标,Salt Player 和糖醋音乐均是寻浔科技(上海)有限公司在中华人民共和国的注册商标