EdgeButton

Composable Component

Wear Material3 EdgeButton that offers a single slot to take any content.

Android
@Composable
public fun EdgeButton(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    buttonSize: EdgeButtonSize = EdgeButtonSize.Small,
    enabled: Boolean = true,
    colors: ButtonColors = ButtonDefaults.buttonColors(),
    border: BorderStroke? = null,
    interactionSource: MutableInteractionSource? = null,
    content: @Composable RowScope.() -> Unit,
)

Parameters

onClickWill be called when the user clicks the button
modifierModifier to be applied to the button. When animating the button to appear/ disappear from the screen, a Modifier.height can be used to change the height of the component, but that won't change the space available for the content (though it may be scaled)
buttonSizeDefines the size of the button. See EdgeButtonSize.
enabledControls the enabled state of the button. When false, this button will not be clickable
colorsButtonColors that will be used to resolve the background and content color for this button in different states. See ButtonDefaults.buttonColors.
borderOptional BorderStroke that will be used to resolve the border for this button in different states.
interactionSourcean optional hoisted MutableInteractionSource for observing and emitting Interactions for this button. You can use this to change the button's appearance or preview the button in different states. Note that if null is provided, interactions will still happen internally.
contentSlot for composable body content displayed on the Button. Either an Icon or Text. Note that when using an Icon is recommended to remove any extra spacing the icon may have, either processing the image or using something like the list sample.