CamoSplitButton
A main action with a menu of related ones ("Save", with "Save as…" behind the arrow). Tab reaches the main part,
then the arrow; Enter or Space presses the focused part; Down or Alt+Down on either opens the menu and
focuses its first item; Esc closes it and returns focus. An onClick of null makes a menu button: one part
that opens the menu. menuContentDescription names the arrow.
API
- Kotlin
- Dart
public fun CamoSplitButton(
text: String,
onClick: (() -> Unit)?,
menu: List<CamoMenuEntry>,
modifier: Modifier = Modifier,
appearance: Appearance? = null,
tone: Tone = Tone.Default,
enabled: Boolean = true,
prefixIcon: (@Composable () -> Unit)? = null,
menuContentDescription: String = "More options",
)
| Name | Type | Default |
|---|---|---|
text | String | required |
onClick | (() -> Unit)? | |
menu | List<CamoMenuEntry> | required |
modifier | Modifier | Modifier |
appearance | Appearance? | null |
tone | Tone | Tone.Default |
enabled | Boolean | true |
prefixIcon | (@Composable () -> Unit)? | null |
menuContentDescription | String | "More options" |
Design notes
Why CamoSplitButton works this way, its states and its edge cases: contributor docs.