Selectable Item
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.
semantics Label
The label to be used for accessibility.
interaction Source
MutableInteractionSource that will be used to emit PressInteraction.Press when this toggleable is being pressed.
enable Icon Indicator
Whether to enable the selected indicator.
selected Icon
The icon to be rendered when the item is selected.
unselected Icon
The icon to be rendered when the item is not selected.
animate Selection
Whether to animate the padding and shape when selected.
animate Selection Options
The options to be used when animating the selection.
content
The content to be rendered passes true if item is selected.