API reference

DropdownItem Class

Represents a single item in a dropdown menu.
Data-class equality includes composable content by reference. Use DropdownItem.key for stable selection and list identity rather than comparing whole items.

Signature

@Immutable
data class DropdownItem(
    val title: String,
    val key: String = title,
    val subtitle: String? = null,
    val enabled: Boolean = true,
    val leadingIcon: @Composable () -> Unit? = null,
    val trailingContent: @Composable () -> Unit? = null,
)

Constructors

DropdownItem ( title , key , subtitle , enabled , leadingIcon , trailingContent )
Signature
constructor(
    title: String,
    key: String = title,
    subtitle: String? = null,
    enabled: Boolean = true,
    leadingIcon: @Composable () -> Unit? = null,
    trailingContent: @Composable () -> Unit? = null,
)
Parameters
title: String  The title text of the item.
key: String  Stable selection identity. Set this explicitly when multiple items share a title.
subtitle: String?  The subtitle text of the item.
enabled: Boolean  A boolean indicating whether the item is enabled or not.
leadingIcon: (@Composable () -> Unit)?  Optional content displayed before the labels.
trailingContent: (@Composable () -> Unit)?  Optional content displayed after the labels.
Returns
DropdownItem

Properties

enabled : Boolean
[Get]
Signature
val enabled: Boolean = true
key : String
[Get]
Signature
val key: String
leadingIcon : (@Composable () -> Unit)?
[Get]
Signature
val leadingIcon: @Composable () -> Unit? = null
subtitle : String?
[Get]
Signature
val subtitle: String? = null
title : String
[Get]
Signature
val title: String
trailingContent : (@Composable () -> Unit)?
[Get]
Signature
val trailingContent: @Composable () -> Unit? = null