AsyncButton

fun AsyncButton(modifier: Modifier = Modifier, isLoading: Boolean = false, enabled: Boolean = isLoading.not(), shape: Shape = ButtonDefaults.shape, containerColor: Color = ButtonDefaults.buttonColors().containerColor, contentColor: Color = ButtonDefaults.buttonColors().contentColor, contentPadding: PaddingValues = ButtonDefaults.ContentPadding, onClick: () -> Unit = {}, content: @Composable RowScope.() -> Unit)

A button that renders a circular progress CircularProgressIndicator in case of loading or content otherwise

Parameters

modifier

Modifier to be applied to the button

isLoading

whether the button should render the content or it's loading indicator

enabled

whether the button is enabled. Note that the button will only be enabled if enabled is true and isLoading is false.

shape

shape to be applied to the button container

containerColor

color of button container

contentColor

color of content

contentPadding

padding to be applied on the content

onClick

click action

content

content of the button