by @alexstyl
✉️ Leave your feedback

← Back to Wear Material

SwipeToRevealPrimaryAction

Component
in
Wear Material
. Since 1.3.0-beta01

Overview

Examples

Community Notes

A composable which can be used for setting the primary action of material SwipeToRevealCard and SwipeToRevealChip.

@param revealState The RevealState of the SwipeToReveal where this action is used. @param onClick A lambda which gets triggered when the action is clicked. @param icon The icon which will be displayed initially on the action @param label The label which will be displayed on the expanded action @param modifier Modifier to be applied on the action @param interactionSource The MutableInteractionSource representing the stream of interactions with this action.

Overloads

SwipeToRevealPrimaryAction

@OptIn(ExperimentalWearFoundationApi::class)
@ExperimentalWearMaterialApi
@Composable
public fun RevealScope.SwipeToRevealPrimaryAction(
    revealState: RevealState,
    onClick: () -> Unit,
    icon: @Composable () -> Unit,
    label: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
)

Parameters

NameDescription
revealStateThe RevealState of the SwipeToReveal where this action is used.
onClickA lambda which gets triggered when the action is clicked.
iconThe icon which will be displayed initially on the action
labelThe label which will be displayed on the expanded action
modifierModifier to be applied on the action
interactionSourceThe MutableInteractionSource representing the stream of interactions with this action
Previous ComponentSwipeToRevealChip
Next ComponentSwipeToRevealSecondaryAction