DialogButtonBar

fun DialogButtonBar(negative: DialogButtonBarAction?, positive: DialogButtonBarAction?, modifier: Modifier = Modifier, neutral: DialogButtonBarAction? = null, dynamicLayout: Boolean = true, showDivider: Boolean = true, hasContentAbove: Boolean = true, colors: TextButtonColors = ButtonDefaults.textButtonColorsBorderless(), dividerColor: Color = COUITheme.colorScheme.dividerLine, textStyle: TextStyle = COUITheme.textStyles.button)

A COUI dialog button bar (COUIButtonBarLayout) that automatically flips between a horizontal row and a vertical stack.

COUIButtonBarLayout.onMeasure keeps the bar horizontal only when every label fits, there are exactly two buttons and there is no recommend button; in every other case it stacks. The two tiers differ by more than direction — min heights, paddings, divider thickness and insets all change, and the buttons appear in the opposite order — so see DialogButtonBarDefaults for the stacked metrics and DialogDefaults for the row ones.

The recommend-button tier (setRecommendButtonId, a highlighted filled button) is not implemented; this bar always behaves as mRecommendButtonId == NO_RECOMMEND_ID.

Parameters

negative

The negative (cancel) action. Hidden when null.

positive

The positive (confirm) action. Hidden when null.

modifier

The modifier to be applied to the bar.

neutral

The neutral (third) action. Hidden when null.

dynamicLayout

Whether the bar may stack itself, like COUIButtonBarLayout.setDynamicLayout.

showDivider

Whether the dividers between buttons are shown, like the buttonBarShowDivider attribute.

hasContentAbove

Whether the dialog shows a title, message or custom panel above the bar. COUI adds DialogButtonBarDefaults.StackedButtonPaddingTopExtra to the top-most stacked button only when nothing sits above it.

colors

The TextButtonColors of the buttons.

dividerColor

The color of the dividers between buttons.

textStyle

The text style of the labels, also used to measure them for the flip decision.