selectable

fun Modifier.selectable(selected: Boolean, enabled: Boolean = true, interactionSource: MutableInteractionSource? = null, style: Style? = null, role: Role? = null, onLongClick: () -> Unit? = null, onClick: () -> Unit): Modifier

Interop Modifier.selectable to apply the correct selectable modifier based on the requirement for hardware input. For example if a Tv device is detected it adds support for hardware clicks from remote controls. This has the added support for Style, applying interactionStyle to update

  • the component based on the current InteractionSource state.

Since

0.2.0

Parameters

selected

Whether the element is currently selected.

enabled

Whether the click action handling is enabled.

interactionSource

The interaction source to emit interaction events to.

style

Optional Style to apply with the selectable.

role

The Role of the associated user interface element, typically used by Accessiblity services.

onClick

Callback when the element is clicked.


fun Modifier.selectable(selected: Boolean, enabled: Boolean = true, interactionSource: MutableInteractionSource? = null, style: StyleScope.() -> Unit? = null, role: Role? = null, onLongClick: () -> Unit? = null, onClick: () -> Unit): Modifier

Interop Modifier.selectable to apply the correct selectable modifier based on the requirement for hardware input. For example if a Tv device is detected it adds support for hardware clicks from remote controls. This has the added support for Style, applying interactionStyle to update

  • the component based on the current InteractionSource state.

Since

0.3.4

Parameters

selected

Whether the element is currently selected.

enabled

Whether the click action handling is enabled.

interactionSource

The interaction source to emit interaction events to.

style

Optional Style block apply with the selectable.

role

The Role of the associated user interface element, typically used by Accessiblity services.

onClick

Callback when the element is clicked.