StylishDialogActions

fun StylishDialogActions(confirmLabel: String, cancelLabel: String, onConfirm: () -> Unit, onCancel: () -> Unit, modifier: Modifier = Modifier, cancelColors: ButtonColors? = null, confirmColors: ButtonColors? = null, spacing: Dp = StylishTheme.dimensions.connectedSpacing, confirmEnabled: Boolean = true, cancelEnabled: Boolean = true, cancelContent: @Composable () -> Unit? = null, confirmContent: @Composable () -> Unit? = null)

A confirm/cancel button row for the bottom of a dialog.

Renders two visually connected buttons — cancel on the left, confirm on the right — using StylishConnectedButtonRow. The cancel button uses a subdued MaterialTheme.colorScheme.surfaceVariant container while the confirm button uses the default prominent style. Place this inside a com.segnities007.stylishui.components.atoms.StylishDialogSurface or any dialog-like container, typically with Modifier.fillMaxWidth passed via modifier.

Parameters

confirmLabel

Text displayed on the confirm button when confirmContent is null.

cancelLabel

Text displayed on the cancel button when cancelContent is null.

onConfirm

Callback invoked when the confirm button is tapped.

onCancel

Callback invoked when the cancel button is tapped.

modifier

Modifier applied to the underlying StylishConnectedButtonRow. Callers control the row's width — pass Modifier.fillMaxWidth to stretch it to the container.

cancelColors

Optional ButtonColors for the cancel button. When null (the default), the subdued MaterialTheme.colorScheme.surfaceVariant container with MaterialTheme.colorScheme.onSurfaceVariant content is used.

confirmColors

Optional ButtonColors for the confirm button. When null (the default), the prominent StylishConnectedButtonRow default colors are used.

spacing

Horizontal gap between the two buttons. Defaults to StylishTheme.dimensions.connectedSpacing.

confirmEnabled

Whether the confirm button is interactive. Defaults to true. Set to false to block confirmation until preconditions are met (e.g. a required field is filled).

cancelEnabled

Whether the cancel button is interactive. Defaults to true.

cancelContent

Optional custom composable rendered inside the cancel button, replacing the cancelLabel text. When null (the default), a Text with cancelLabel is rendered.

confirmContent

Optional custom composable rendered inside the confirm button, replacing the confirmLabel text. When null (the default), a Text with confirmLabel is rendered.

See also