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


PaymentBox( stack: PaymentStack.horizontal, distribute: PaymentDistribute.spaceBetween, alignY: PaymentAlign.center, children: [PaymentInline('Total'), PaymentInline('IDR 50.000')], );Variants
Section titled “Variants”Variants: horizontal, vertical, layered.
Which variant when
Section titled “Which variant when”| 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.
States
Section titled “States”The box lays out its children; loading, errors and actions belong to those children.
Do and don’t
Section titled “Do and don’t”Do: Choose semantic padding and gap tokens; layered is only for deliberate overlap.
Don’t: Pass raw sizes or invent shadow tokens.
Content guidelines
Section titled “Content guidelines”Use semantic padding and gap roles to group related payment facts.
Accessibility
Section titled “Accessibility”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.
| Parameter | Type | Default | Description |
|---|---|---|---|
children:required | List<Widget> | — | children; uses semantic tokens. |
stack: | PaymentStack | PaymentStack.vertical | stack; uses semantic tokens. |
padding: | PaymentSpace | PaymentSpace.none | padding; uses semantic tokens. |
paddingX: | PaymentSpace? | — | paddingX; uses semantic tokens. |
paddingY: | PaymentSpace? | — | paddingY; uses semantic tokens. |
gap: | PaymentSpace | PaymentSpace.none | gap; uses semantic tokens. |
distribute: | PaymentDistribute | PaymentDistribute.packed | distribute; uses semantic tokens. |
alignX: | PaymentAlign | PaymentAlign.stretch | alignX; uses semantic tokens. |
alignY: | PaymentAlign | PaymentAlign.start | alignY; uses semantic tokens. |
wrap: | bool | false | wrap; uses semantic tokens. |
background: | PaymentBoxBackground | PaymentBoxBackground.none | background; uses semantic tokens. |
radius: | PaymentRadius | PaymentRadius.none | radius; uses semantic tokens. |
keyline: | PaymentKeyline | PaymentKeyline.none | keyline; uses semantic tokens. |
width: | PaymentWidth | PaymentWidth.fill | width; uses semantic tokens. |
PaymentStack
enum PaymentStack · lib/src/layout/layout.dart
Layout direction.
| Value | Description |
|---|---|
horizontal | horizontal. |
vertical | vertical. |
layered | layered. |
PaymentDistribute
enum PaymentDistribute · lib/src/layout/layout.dart
Sibling distribution.
| Value | Description |
|---|---|
packed | packed. |
spaceBetween | spaceBetween. |
PaymentAlign
enum PaymentAlign · lib/src/layout/layout.dart
Axis alignment.
| Value | Description |
|---|---|
start | start. |
center | center. |
end | end. |
stretch | stretch. |
baseline | baseline. |
PaymentBoxBackground
enum PaymentBoxBackground · lib/src/layout/layout.dart
Semantic surface.
| Value | Description |
|---|---|
none | none. |
surface | surface. |
muted | muted. |
PaymentKeyline
enum PaymentKeyline · lib/src/layout/layout.dart
Semantic one-pixel edge.
| Value | Description |
|---|---|
none | none. |
neutral | neutral. |
critical | critical. |
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.
| Value | Description |
|---|---|
none | Zero gap. |
inline | spacing × 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. |
related | spacing (8): between stacked or adjacent actions and chips, text → trailing control, compact control padding. |
block | spacing × 1.5 (12): icon → text, band → title, list row and header padding, notice and banner padding. |
group | spacing × 2 (16): screen, sheet and field gutters, label → value, state message padding. |
section | spacing × 3 (24): content → primary action, between field groups, ruled section gaps. |
major | spacing × 4 (32): largest gap; unused by kit widgets today. |
PaymentRadius
enum PaymentRadius · lib/src/foundation/payment_tokens.dart
Corner roles for PaymentBox and PaymentImage.
| Value | Description |
|---|---|
none | BorderRadius.zero. |
tag | tagBorderRadius (4 by default). |
control | controlBorderRadius (6 by default). |
box | borderRadius (8 by default). |
sheet | sheetBorderRadius (12 by default). |
circle | BorderRadius.circular(999), existing navigation pill. |
PaymentWidth
enum PaymentWidth · lib/src/foundation/payment_tokens.dart
Width policy; labels wrap and never truncate.
| Value | Description |
|---|---|
fill | Parent width, the default. |
hug | Content width. |