Popups
A popup in Compose Multiplatform is a floating container that renders its content on top of the current UI within the same window.
Unlike the multiplatform Dialog() API, a Popup() is non-modal. A dialog in Compose Multiplatform acts as a modal container that takes focus, centers its content, and uses a dimmed scrim to block interaction with the rest of the UI. A popup, on the other hand, has no scrim, does not restrict its width, and allows users to continue interacting with the underlying UI. It is not centered by default and requires additional arguments to anchor it to a component.
Use Dialog() when you need to interrupt the user and require a decision before they continue, for example, react to confirmations, alerts, or short forms. For separate OS-level dialogs on desktop, see DialogWindow(). Use Popup() for lightweight, non-blocking overlays that stay anchored to a component inside the current window, such as dropdowns, tooltips, and menus.
Position a popup
To position a popup, use either an alignment and offset, or a custom PopupPositionProvider for anchored placement.
For a simple alignment:
For anchored placement, use a PopupPositionProvider:
Customize behavior
With PopupProperties, you can control how the popup handles focus and dismissal:
focusabledetermines whether the popup receives key events, disabled by default.dismissOnBackPressdismisses the popup on Android's back button or the Esc key on desktop, enabled by default. Requiresfocusable = true.dismissOnClickOutsidedismisses the popup when the user presses outside its bounds, enabled by default.
Popup() and its PopupProperties are part of the common API. However, some properties are not available in the common source set. For example, usePlatformInsets is available on iOS, where it limits the popup's content to the platform insets (the safe area).
What's next
For full API details, see the references in the Jetpack Compose documentation: