🌈 Create new beautiful Compose Gradients with our new wesite ->
Compose Component

CheckableDropdownMenuItem

Material Design dropdown menu Menus display a list of choices on a temporary surface.

CheckableDropdownMenuItem social preview

CheckableDropdownMenuItem

Source set: Common
@Composable
public fun CheckableDropdownMenuItem(
    checked: Boolean,
    onCheckedChange: (Boolean) -> Unit,
    text: @Composable () -> Unit,
    shapes: MenuItemShapes,
    modifier: Modifier = Modifier,
    leadingIcon: @Composable (() -> Unit)? = null,
    checkedLeadingIcon: @Composable (() -> Unit)? = null,
    trailingContent: @Composable (() -> Unit)? = null,
    supportingText: @Composable (() -> Unit)? = null,
    enabled: Boolean = true,
    colors: SelectableMenuItemColors = MenuDefaults.selectableItemColors(),
    horizontalArrangement: Arrangement.Horizontal =
        MenuDefaults.DropdownMenuItemHorizontalArrangement,
    contentPadding: PaddingValues = MenuDefaults.DropdownMenuSelectableItemContentPadding,
    interactionSource: MutableInteractionSource? = null,
)

Parameters

checked whether this menu item is currently checked.
onCheckedChange called when this menu item is clicked, with the new checked state.
text text of the menu item.
shapes MenuItemShapes that will be used to resolve the shapes for this menu item. The shape of this item is determined by the value of checked. The shapes provided should be determined by the number of items in the group or menu as well as the item's position in the menu. There is a convenience function that can be used to easily determine the shape to be used at MenuDefaults.itemShape
modifier the Modifier to be applied to this menu item.
leadingIcon optional leading icon to be displayed when the item is unchecked.
checkedLeadingIcon optional leading icon to be displayed when the item is checked.
trailingContent optional trailing content to be displayed at the end of the item's text.
supportingText optional supporting text of the menu item.
enabled controls the enabled state of this menu item. When false, this component will not respond to user input.
colors SelectableMenuItemColors that will be used to resolve the colors for this menu item. There are two predefined SelectableMenuItemColors at MenuDefaults.selectableItemColors and MenuDefaults.selectableItemVibrantColors which you can use or modify.
horizontalArrangement the horizontal arrangement of the menu item's children.
contentPadding the padding applied to the content of this menu item.
interactionSource an optional hoisted MutableInteractionSource for observing and emitting Interactions for this menu item.

Content updated: