Skip to main content

CamoPopover

A non-modal panel anchored to anchor for content richer than a menu and lighter than a dialog: a few lines, a small form, one or two actions. Its visibility is state (open), like every controlled component: the app's button toggles it. It opens on the placement side (below by default, above when there is no room), and an outside tap, back and Esc all call onDismissRequest. Focus moves into it when it opens and back to the anchor when it closes. The anchor should be one control (a button): it announces that it has a popup.

API​

public fun CamoPopover(
open: Boolean,
onDismissRequest: () -> Unit,
anchor: @Composable () -> Unit,
modifier: Modifier = Modifier,
title: String? = null,
actions: (@Composable RowScope.() -> Unit)? = null,
placement: PopoverPlacement = PopoverPlacement.Auto,
content: @Composable ColumnScope.() -> Unit,
)
NameTypeDefault
openBooleanrequired
onDismissRequest() -> Unitrequired
anchor@Composable () -> Unitrequired
modifierModifierModifier
titleString?null
actions(@Composable RowScope.() -> Unit)?null
placementPopoverPlacementPopoverPlacement.Auto
content@Composable ColumnScope.() -> Unitrequired
Design notes

Why CamoPopover works this way, its states and its edge cases: contributor docs.