Skip to main content

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​

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",
)
NameTypeDefault
textStringrequired
onClick(() -> Unit)?
menuList<CamoMenuEntry>required
modifierModifierModifier
appearanceAppearance?null
toneToneTone.Default
enabledBooleantrue
prefixIcon(@Composable () -> Unit)?null
menuContentDescriptionString"More options"
Design notes

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