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
- Kotlin
- Dart
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,
)
| Name | Type | Default |
|---|---|---|
open | Boolean | required |
onDismissRequest | () -> Unit | required |
anchor | @Composable () -> Unit | required |
modifier | Modifier | Modifier |
title | String? | null |
actions | (@Composable RowScope.() -> Unit)? | null |
placement | PopoverPlacement | PopoverPlacement.Auto |
content | @Composable ColumnScope.() -> Unit | required |
Design notes
Why CamoPopover works this way, its states and its edge cases: contributor docs.