Skip to content
Get started
Menu
Get started

Button group

PaymentButtonGroup arranges related payment actions in a row or vertical stack. Use it for status actions, confirmations and module headers. Horizontal buttons hug their labels; the first action stays visible, and destructive actions occupy a separate final overflow group.

Grouped payment actions using different collapse rules and a long wrapping label.Grouped payment actions using different collapse rules and a long wrapping label.
Button group
Grouped payment actions using different collapse rules and a long wrapping label at 200 percent text.
200% text
example/lib/screens/gallery_content.dart
PaymentButtonGroup(
direction: Axis.vertical,
children: [
PaymentButton(label: 'Check status', onPressed: () {}),
PaymentButton(
label: 'Start new payment',
variant: PaymentButtonVariant.secondary,
onPressed: () {},
),
],
);

ViewFooter stacks its group vertically at full width below 600 dp and at large text, primary on top. In page headers, groups only appear on wide screens; phones show a title-row link or ⋮ instead.

Variants: horizontal auto overflow, horizontal none, vertical.

collapse: PaymentButtonGroupCollapse.none keeps one row of hug buttons while they fit. When they don’t, every button stacks at full width, with the emphasized action (primary or destructive, passed last) on top. A stacked group never leaves a ragged edge (D45, #65).

The first action stays visible; trailing actions move into a ⋮ menu, and destructive actions always go there. On a phone that menu is a bottom action sheet.

Choose horizontal overflow when supporting actions may move into a menu, no-collapse when all actions must remain visible, or vertical for a stacked group.

Situation Variant / composition Payment example
Report footer vertical Stack Send before Cancel on phones; use automatic menu overflow for detail header actions.

Use a single Button when there is one action.

Each button keeps its own disabled and busy state. Overflow changes where an action appears, not when it is available.

Do: Stack Send before Cancel on phones; use automatic menu overflow for detail header actions.

Don’t: Place destructive and primary actions together in a vertical group.

Use action labels such as “View receipt” and “Contact support”. Keep destructive actions separate from ordinary alternatives.

Buttons keep their labels and keyboard behavior when moved into overflow. Long overflow labels wrap at large text.

Example statement screen with synthetic dataExample statement screen with synthetic data
Example: statement

PaymentButtonGroup

class PaymentButtonGroup extends StatefulWidget · lib/src/controls/button_group.dart

Related actions with at most one primary and separated destructive actions.

ParameterTypeDefaultDescription
children:requiredList<PaymentButton>—Actions in host reading order.
direction:AxisAxis.horizontalVertical actions fill the available width.
collapse:PaymentButtonGroupCollapsePaymentButtonGroupCollapse.autoHorizontal overflow policy.
menuTrigger:Widget Function(VoidCallback toggle, FocusNode focusNode)?—Optional menu trigger receiving its toggle and focus node.

PaymentButtonGroupCollapse

enum PaymentButtonGroupCollapse · lib/src/controls/button_group.dart

Responsive action overflow policy.

ValueDescription
autoMove trailing actions into a menu, retaining the first action.
noneStack an overflowing row at full width, with the emphasized action on top.