SelectableItem

fun SelectableItem(item: Item, modifier: Modifier = Modifier, semanticsLabel: String = DEFAULT_LABEL, interactionSource: MutableInteractionSource? = null, enableIconIndicator: Boolean = true, selectedIcon: @Composable BoxScope.() -> Unit = { SelectedIcon() }, unselectedIcon: @Composable BoxScope.() -> Unit = { UnselectedIcon() }, animateSelection: Boolean = true, animateSelectionOptions: AnimateSelectionOptions = AnimateSelectionDefaults.Default, aspectRatio: Float = 1.0f, content: @Composable (toggled: Boolean) -> Unit)

A Composable that provides selectable support for the content.

Parameters

item

The item that is being rendered.

modifier

The modifier to be applied to the item.

semanticsLabel

The label to be used for accessibility.

interactionSource

MutableInteractionSource that will be used to emit PressInteraction.Press when this toggleable is being pressed.

enableIconIndicator

Whether to enable the selected indicator.

selectedIcon

The icon to be rendered when the item is selected.

unselectedIcon

The icon to be rendered when the item is not selected.

animateSelection

Whether to animate the padding and shape when selected.

animateSelectionOptions

The options to be used when animating the selection.

content

The content to be rendered passes true if item is selected.