androidx.compose.material3
MenuItemColors
Class
No hand-written docs yet.
Represents the text and icon colors used in a menu item at different states.
class MenuItemColors(
textColor: Color,
leadingIconColor: Color,
trailingIconColor: Color,
disabledTextColor: Color,
disabledLeadingIconColor: Color,
disabledTrailingIconColor: Color,
containerColor: Color,
disabledContainerColor: Color,
selectedTextColor: Color,
selectedLeadingIconColor: Color,
selectedTrailingIconColor: Color,
selectedContainerColor: Color,
)
How to get one
Create it
MenuItemColors(textColor, leadingIconColor, trailingIconColor, disabledTextColor, disabledLeadingIconColor, disabledTrailingIconColor, containerColor, disabledContainerColor, selectedTextColor, selectedLeadingIconColor, selectedTrailingIconColor, selectedContainerColor)constructor
Ready-made values and functions that return it
Used by
Parameters that take a MenuItemColors.
Properties
containerColorSince 1.11
val containerColor: Color
The container color of this menu item when enabled and unselected.
disabledContainerColorSince 1.11
val disabledContainerColor: Color
The container color of this menu item when not enabled
selectedContainerColorSince 1.11
val selectedContainerColor: Color
The container color of this menu item when enabled and selected.
selectedTextColorSince 1.11
val selectedTextColor: Color
The text color of this menu item when enabled and selected.
selectedLeadingIconColorSince 1.11
val selectedLeadingIconColor: Color
The leading icon color of this menu item when enabled and selected.
selectedTrailingIconColorSince 1.11
val selectedTrailingIconColor: Color
The trailing icon color of this menu item when enabled and selected.
textColor
val textColor: Color
leadingIconColor
val leadingIconColor: Color
trailingIconColor
val trailingIconColor: Color
disabledTextColor
val disabledTextColor: Color
disabledLeadingIconColor
val disabledLeadingIconColor: Color
disabledTrailingIconColor
val disabledTrailingIconColor: Color
Functions
copy
fun copy(
textColor: Color = this.textColor,
containerColor: Color = this.containerColor,
leadingIconColor: Color = this.leadingIconColor,
trailingIconColor: Color = this.trailingIconColor,
disabledTextColor: Color = this.disabledTextColor,
disabledContainerColor: Color = this.disabledContainerColor,
disabledLeadingIconColor: Color = this.disabledLeadingIconColor,
disabledTrailingIconColor: Color = this.disabledTrailingIconColor,
selectedTextColor: Color = this.selectedTextColor,
selectedContainerColor: Color = this.selectedContainerColor,
selectedLeadingIconColor: Color = this.selectedLeadingIconColor,
selectedTrailingIconColor: Color = this.selectedTrailingIconColor,
): MenuItemColors
Returns a copy of this MenuItemColors, optionally overriding some of the values. This uses the Color.Unspecified to mean “use the value from the source”
fun copy(
textColor: Color = this.textColor,
leadingIconColor: Color = this.leadingIconColor,
trailingIconColor: Color = this.trailingIconColor,
disabledTextColor: Color = this.disabledTextColor,
disabledLeadingIconColor: Color = this.disabledLeadingIconColor,
disabledTrailingIconColor: Color = this.disabledTrailingIconColor,
): MenuItemColors
Returns a copy of this MenuItemColors, optionally overriding some of the values. This uses the Color.Unspecified to mean “use the value from the source”
Library docs
Represents the text and icon colors used in a menu item at different states.