API reference

IconDropdown Composable

Displays an icon-only trigger that opens a single-selection menu.
Use this form in toolbars where the icon and surrounding context communicate the menu's purpose.

Signature

@Composable
fun IconDropdown(
    icon: @Composable () -> Unit,
    items: PersistentList<DropdownItem>,
    onItemSelected: (DropdownItem) -> Unit,
    modifier: Modifier = Modifier,
    filled: Boolean = true,
    enabled: Boolean = true,
    selectedItem: DropdownItem? = null,
    showDividers: Boolean = false,
    menuModifier: Modifier = Modifier,
    colors: DropdownColors = if (filled) DropdownDefaults.Filled else DropdownDefaults.Borderless,
    dimensions: DropdownDimensions = UiSetTheme.dimensions.dropdowns,
    shape: Shape = UiSetTheme.shapes.pill,
    menuShape: Shape = UiSetTheme.shapes.menu,
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
    indication: UiSetIndicationSpec? = UiSetTheme.indications.subtle.default,
)

Parameters

icon: @Composable () -> Unit trigger icon
items: PersistentList immutable snapshot of menu items
onItemSelected: (DropdownItem) -> Unit callback receiving the selected item
modifier: Modifier modifier applied to the full trigger target
filled: Boolean whether to use the filled rather than borderless default treatment
enabled: Boolean whether the trigger accepts input
selectedItem: DropdownItem? current selection matched to items by DropdownItem.key, or null
showDividers: Boolean whether menu items are separated by dividers instead of spacing
menuModifier: Modifier modifier applied to the popup menu; set DropdownColors.menuContainerColor to transparent when the modifier draws the complete menu background
colors: DropdownColors trigger, menu, selection, divider, and disabled colors
dimensions: DropdownDimensions trigger, menu, item, icon, and spacing geometry
shape: Shape trigger shape
menuShape: Shape popup menu shape
interactionSource: MutableInteractionSource interaction stream shared with callers observing trigger state
indication: UiSetIndicationSpec? interaction feedback split around trigger and menu-item clipping boundaries