API reference

Dropdown Composable

Displays a labeled trigger that opens a single-selection menu.
Use this form in settings and forms where the current value should remain visible.

Signature

@Composable
fun Dropdown(
    items: PersistentList<DropdownItem>,
    onItemSelected: (DropdownItem) -> Unit,
    modifier: Modifier = Modifier,
    filled: Boolean = true,
    leadingIcon: @Composable () -> Unit? = null,
    placeholder: String = stringResource(R.string.uiset_dropdown_placeholder),
    supportingText: String? = null,
    enabled: Boolean = true,
    selectedItem: DropdownItem? = null,
    showChevron: Boolean = true,
    showDividers: Boolean = false,
    menuModifier: Modifier = Modifier,
    colors: DropdownColors = if (filled) DropdownDefaults.Filled else DropdownDefaults.Borderless,
    dimensions: DropdownDimensions = UiSetTheme.dimensions.dropdowns,
    shape: Shape = UiSetTheme.shapes.button,
    menuShape: Shape = UiSetTheme.shapes.menu,
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
    indication: UiSetIndicationSpec? = UiSetTheme.indications.subtle.default,
)

Parameters

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
leadingIcon: (@Composable () -> Unit)? optional trigger icon
placeholder: String text shown when selectedItem is null
supportingText: String? optional second line when the selected item has no subtitle
enabled: Boolean whether the trigger accepts input
selectedItem: DropdownItem? current selection matched to items by DropdownItem.key, or null
showChevron: Boolean whether to show the menu affordance
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