CamoMenu
A menu attached to anchor (an overflow button, a split button's arrow): anchor gets open for its click.
The menu shows items, or panel's custom content in a CamoMenuPanel (ADR-30), below the anchor (above
it near the bottom edge). Opened from the keyboard, the first item takes focus; Up and Down move, Home and
End jump, typing jumps to the next item starting with the typed letters, Enter selects, and Esc or an outside
tap closes it, returning focus to the anchor. With speedSearch typing instead filters the items by what was
typed (prefix, substring or camel-hump), highlights the matches, and Esc clears the text before it closes the
menu; a menu with submenus keeps the plain type-ahead.
API
- Kotlin
- Dart
public fun CamoMenuAnchor(
modifier: Modifier = Modifier,
items: List<CamoMenuEntry> = emptyList(),
panel: (@Composable () -> Unit)? = null,
controller: CamoMenuController? = null,
speedSearch: Boolean = false,
anchor: @Composable (open: () -> Unit) -> Unit,
)
| Name | Type | Default |
|---|---|---|
modifier | Modifier | Modifier |
items | List<CamoMenuEntry> | emptyList() |
panel | (@Composable () -> Unit)? | null |
controller | CamoMenuController? | null |
speedSearch | Boolean | false |
anchor | @Composable (open: () -> Unit) -> Unit | required |
Why CamoMenu works this way, its states and its edge cases: contributor docs.