LoadingButton

fun LoadingButton(text: String, onClick: () -> Unit, modifier: Modifier = Modifier, isLoading: Boolean = false, loadingText: String? = null, enabled: Boolean = true, cornerRadius: Dp = ButtonDefaults.CornerRadius, minWidth: Dp = ButtonDefaults.MinWidth, minHeight: Dp = ButtonDefaults.MinHeight, colors: TextButtonColors = ButtonDefaults.textButtonColors(), insideMargin: PaddingValues = ButtonDefaults.InsideMargin, interactionSource: MutableInteractionSource? = null, indication: Indication? = null)

A LoadingButton component with COUI style.

A text button that can switch into a loading state, mirroring COUILoadingButton: while isLoading is true the label is hidden and three tiny dots pulse in a staggered wave (each dot fades 20% -> 50% -> 100% -> 50% -> 20% alpha, dots offset by 333ms over a 1332ms cycle), and clicks are swallowed so the action cannot be triggered again.

When loadingText is provided, the loading state shows that label followed by three animated dot glyphs instead of the plain dot indicator (COUIButton isShowLoadingText / loadingText).

Parameters

text

The text of the LoadingButton when it is not loading.

onClick

The callback when the LoadingButton is clicked. Not invoked while isLoading.

modifier

The modifier to be applied to the LoadingButton.

isLoading

Whether the LoadingButton is in the loading state.

loadingText

The text shown next to the animated dots while loading, or null to show only the dot indicator.

enabled

Whether the LoadingButton is enabled.

cornerRadius

The corner radius of the LoadingButton.

minWidth

The minimum width of the LoadingButton.

minHeight

The minimum height of the LoadingButton.

colors

The TextButtonColors of the LoadingButton. The loading dots use the content color, like COUILoadingButton draws them with the label paint.

insideMargin

The margin inside the LoadingButton.

interactionSource

The MutableInteractionSource to be used for the LoadingButton.

indication

The Indication to be used for the LoadingButton. Defaults to null because the COUI press feedback (scale + press tint) is built into the button itself.