DropdownItem

data class DropdownItem(val text: String, val enabled: Boolean = true, val selected: Boolean = false, val onClick: () -> Unit? = null, val icon: @Composable (Modifier) -> Unit? = null, val summary: String? = null, val children: List<DropdownItem>? = null)

An item shown inside a dropdown, spinner, or dropdown menu.

Parameters

text

Text shown for the item.

enabled

Whether the item can be clicked.

selected

Whether the item is selected.

onClick

Callback invoked when the item is clicked. Ignored when children is non-null and non-empty (the click is consumed by the cascading layer to expand the submenu).

icon

Optional icon shown before text.

summary

Optional summary shown below text.

children

Optional submenu items. When non-null and non-empty, this item becomes a submenu trigger: cascading dropdown popups render a chevron and open a child popup on click, recursively. Stabilize this list (e.g. via remember) to avoid unnecessary recomposition.

Constructors

Link copied to clipboard
constructor(text: String, enabled: Boolean = true, selected: Boolean = false, onClick: () -> Unit? = null, icon: @Composable (Modifier) -> Unit? = null, summary: String? = null, children: List<DropdownItem>? = null)
constructor(icon: @Composable (Modifier) -> Unit? = null, title: String? = null, summary: String? = null)

SpinnerEntry compatibility

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val onClick: () -> Unit?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard