API reference

SpatialIconDropdown Function

Icon dropdowns are a variant of dropdowns that display an icon instead of a title. They are useful when the dropdown is used in a context where the icon is more relevant than the text.

Signature

fun SpatialIconDropdown(
    icon: () -> Unit,
    items: List<SpatialDropdownItem>,
    onItemSelected: (SpatialDropdownItem) -> Unit,
    modifier: Modifier = Modifier,
    filled: Boolean = true,
    enabled: Boolean = true,
    selectedItem: SpatialDropdownItem? = null,
    showChevron: Boolean = true,
    menuModifier: Modifier = Modifier,
    showDividers: Boolean = false,
)

Parameters

icon: () -> Unit A composable function that provides the icon for the dropdown.
items: List<SpatialDropdownItem> The list of items to be displayed in the dropdown.
onItemSelected: (SpatialDropdownItem) -> Unit The callback to be invoked when an item is selected.
modifier: Modifier The Modifier to be applied to this dropdown.
filled: Boolean Whether the dropdown is filled or not. Defaults to true.
enabled: Boolean Whether the dropdown is enabled or disabled.
selectedItem: SpatialDropdownItem? The currently selected item in the dropdown.
showChevron: Boolean Whether to show the chevron, in the case of a pill variant. Defaults to true.
menuModifier: Modifier The Modifier to be applied to the menu.
showDividers: Boolean Whether to show dividers between items. Defaults to false.