TextButton

fun TextButton(text: String, onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, pressScaleEnabled: Boolean = true, cornerRadius: Dp = ButtonDefaults.CornerRadius, minWidth: Dp = ButtonDefaults.MinWidth, minHeight: Dp = ButtonDefaults.MinHeight, colors: TextButtonColors = ButtonDefaults.textButtonColors(), insideMargin: PaddingValues = ButtonDefaults.InsideMargin, textStyle: TextStyle = COUITheme.textStyles.button, interactionSource: MutableInteractionSource? = null, indication: Indication? = null)

A TextButton component with COUI style.

Parameters

text

The text of the TextButton.

onClick

The callback when the TextButton is clicked.

modifier

The modifier to be applied to the TextButton.

enabled

Whether the TextButton is enabled.

pressScaleEnabled

Whether the TextButton shrinks while pressed (COUIButton scaleEnable). Set to false for buttons that fill a container cell, such as the alert dialog button bar, leaving the full-cell press tint as the only feedback.

cornerRadius

The corner radius of the TextButton.

minWidth

The minimum width of the TextButton.

minHeight

The minimum height of the TextButton.

colors
insideMargin

The margin inside the TextButton.

textStyle

The TextStyle of the label. Pass a 14sp style together with the Small metrics from ButtonDefaults to get the COUI small size tier.

interactionSource

The MutableInteractionSource to be used for the TextButton.

indication

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