Skip to content
Get started
Menu
Get started

Box

Token-only spacing and surfaces for the virtual account block.

Token-based boxes showing horizontal totals, stacked content, badges and a scheduled payment.Token-based boxes showing horizontal totals, stacked content, badges and a scheduled payment.
Box
example/lib/screens/gallery_layout.dart
PaymentBox(
stack: PaymentStack.horizontal,
distribute: PaymentDistribute.spaceBetween,
alignY: PaymentAlign.center,
children: [PaymentInline('Total'), PaymentInline('IDR 50.000')],
);

Variants: horizontal, vertical, layered.

Situation Variant / composition Payment example
Group payment facts vertical Choose semantic padding and gap tokens; layered is only for deliberate overlap.

Use Inline for styled text spans.

The box lays out its children; loading, errors and actions belong to those children.

Do: Choose semantic padding and gap tokens; layered is only for deliberate overlap.

Don’t: Pass raw sizes or invent shadow tokens.

Use semantic padding and gap roles to group related payment facts.

Keep the child order consistent with reading order, including in layered layouts.

PaymentBox

class PaymentBox extends StatelessWidget · lib/src/layout/layout.dart

Token-only layout container. Never merges child semantics.

ParameterTypeDefaultDescription
children:requiredList<Widget>—children; uses semantic tokens.
stack:PaymentStackPaymentStack.verticalstack; uses semantic tokens.
padding:PaymentSpacePaymentSpace.nonepadding; uses semantic tokens.
paddingX:PaymentSpace?—paddingX; uses semantic tokens.
paddingY:PaymentSpace?—paddingY; uses semantic tokens.
gap:PaymentSpacePaymentSpace.nonegap; uses semantic tokens.
distribute:PaymentDistributePaymentDistribute.packeddistribute; uses semantic tokens.
alignX:PaymentAlignPaymentAlign.stretchalignX; uses semantic tokens.
alignY:PaymentAlignPaymentAlign.startalignY; uses semantic tokens.
wrap:boolfalsewrap; uses semantic tokens.
background:PaymentBoxBackgroundPaymentBoxBackground.nonebackground; uses semantic tokens.
radius:PaymentRadiusPaymentRadius.noneradius; uses semantic tokens.
keyline:PaymentKeylinePaymentKeyline.nonekeyline; uses semantic tokens.
width:PaymentWidthPaymentWidth.fillwidth; uses semantic tokens.

PaymentStack

enum PaymentStack · lib/src/layout/layout.dart

Layout direction.

ValueDescription
horizontalhorizontal.
verticalvertical.
layeredlayered.

PaymentDistribute

enum PaymentDistribute · lib/src/layout/layout.dart

Sibling distribution.

ValueDescription
packedpacked.
spaceBetweenspaceBetween.

PaymentAlign

enum PaymentAlign · lib/src/layout/layout.dart

Axis alignment.

ValueDescription
startstart.
centercenter.
endend.
stretchstretch.
baselinebaseline.

PaymentBoxBackground

enum PaymentBoxBackground · lib/src/layout/layout.dart

Semantic surface.

ValueDescription
nonenone.
surfacesurface.
mutedmuted.

PaymentKeyline

enum PaymentKeyline · lib/src/layout/layout.dart

Semantic one-pixel edge.

ValueDescription
nonenone.
neutralneutral.
criticalcritical.

PaymentSpace

enum PaymentSpace · lib/src/foundation/payment_tokens.dart

Spacing roles resolved by PaymentTheme.space; nothing else exists.

The scale is 4 / 8 / 12 / 16 / 24 / 32 on the 8 base (D46). Each role below has one value; a gap that serves a listed role uses that role and no other. Component sizes (36, 40, 48, 52, 56, 60, 64 dp) are sizes, not spacing roles.

ValueDescription
noneZero gap.
inlinespacing × 0.5 (4): label → caption, title → message, title → meta, a small glyph beside its text, a field's label above its box at large text.
relatedspacing (8): between stacked or adjacent actions and chips, text → trailing control, compact control padding.
blockspacing × 1.5 (12): icon → text, band → title, list row and header padding, notice and banner padding.
groupspacing × 2 (16): screen, sheet and field gutters, label → value, state message padding.
sectionspacing × 3 (24): content → primary action, between field groups, ruled section gaps.
majorspacing × 4 (32): largest gap; unused by kit widgets today.

PaymentRadius

enum PaymentRadius · lib/src/foundation/payment_tokens.dart

Corner roles for PaymentBox and PaymentImage.

ValueDescription
noneBorderRadius.zero.
tagtagBorderRadius (4 by default).
controlcontrolBorderRadius (6 by default).
boxborderRadius (8 by default).
sheetsheetBorderRadius (12 by default).
circleBorderRadius.circular(999), existing navigation pill.

PaymentWidth

enum PaymentWidth · lib/src/foundation/payment_tokens.dart

Width policy; labels wrap and never truncate.

ValueDescription
fillParent width, the default.
hugContent width.