Skip to content
Get started
Menu
Get started

Spacing and radius

Use PaymentSpace for spacing and PaymentRadius for corner roles. Resolve them from the current theme rather than repeating numeric values at component call sites.

The scale is 4 / 8 / 12 / 16 / 24 / 32 on the 8 base: an 8 pt grid with 4 pt half-steps, so block (12) is on the grid. Every kit spacing value resolves through theme.space(PaymentSpace.<role>), and one role uses one value: icon → text uses block (12) in the toast, banner, state message, accordion, skeleton, list row and status header alike.

All seven spacing roles, from none at 0 dp to major at 32 dp, with labelled gaps between paired markers.All seven spacing roles, from none at 0 dp to major at 32 dp, with labelled gaps between paired markers.
PaymentSpace roles resolved by the example theme
The gap is… Role
No gap none
Within one label inline
Between related rows or actions related
Between an icon and row text, or row padding block
A gutter, or between a label and its value group
Before a primary action or a ruled section section
The largest reserved gap major

Values use the default 8 dp base. Each bar shows the value at 4 CSS pixels per dp; none has zero width.

TokenValueUseDon't
none0 dpNo gap.—
inline4 dpLabel to caption, title to message, title to meta, a small glyph beside its text, a field's label above its box at large text.Not between rows.
related8 dpBetween stacked or adjacent actions and chips, text to a trailing control, compact control padding.Not icon to text: that is block.
block12 dpIcon to text, band to title, list row and header padding, notice and banner padding.—
group16 dpScreen, sheet and field gutters, label to value, state message padding.No gutter other than 16 at any width.
section24 dpContent to primary action, between field groups, ruled section gaps.—
major32 dpLargest gap, unused by kit widgets today.—

PaymentTheme.radius (default 8) is the box role and the base of the others. A theme may set tagRadius, controlRadius or sheetRadius to change one role; an unset role keeps its multiple: tag 0.5 (4), control 0.75 (6), sheet 1.5 (12). PaymentRadius and the theme getters (tagBorderRadius, controlBorderRadius, borderRadius, sheetBorderRadius) resolve the current role. See Corner roles.

Each 64 CSS pixel square shows the top-left corner of a 48 dp tile at 8× magnification (8 CSS pixels per dp). The window covers 8 dp in each direction, making small radii visible. The unbounded circle token (999, pill) is shown separately as a complete 64 px circle, rather than a corner detail.

TokenValueUseDon't
none0 dpNo rounding.—
tag4 dpBadges, tags, skeletons.Not buttons.
control6 dpControls, menus, notices, tooltip and toast.Not sheets.
box8 dpSelectable boxes and promo card layout.Not nested inside another box with radius 8.
sheet12 dpSheet tops and dialogs.Not inline content.
circle999 (pill)Existing navigation pill; round controls.—

These component details are fixed literals in lib/, not PaymentRadius roles or exported tokens. This static list links to each source; the 24 dp focus ring is separate from the 999 pill token. Except for the focus ring, corner details use the same 8× magnification (8 CSS pixels per dp) in 64 px windows. The meter / chart row shows top-left and bottom-left details: chart bars round only their top corners.

24 on a 48 dp square is a circle; it differs from 999 only on wider shapes.

Component detail Radius (dp) Corner detail Source
Icon-button focus ring 24 Whole 48 dp control at 4/3× (64 px) actions.dart:101
Status band 3 primitives.dart:1066
Meter / chart bar tops 2 BalanceCard:442, verification meter:668, chart bar:407
Step bar 1.5 payment_extras.dart:352
Navigation indicator 1 navigation.dart:181

Heights and boxes are component sizes, not spacing roles, so they are not PaymentSpace values. They sit on the 4 grid: 36 (small button, InfoRow pitch), 40 (media tile), 48 (minimum target, list row, small field), 52 (the _ControlRow control column), 56 (medium field, large button), 60 (video play disc) and 64 (large list row, large field). A two-line list row is 62 dp (12 + 20 + 18 + 12): its parts are on the grid, and the loading skeleton copies it. The spacing scale and standard component heights use the 4 dp grid. Fixed bar thicknesses and strokes are exceptions: StatusBand is 6 dp high (primitives.dart:1063), and the step bar is 3 dp high (payment_extras.dart:349). These are component details, not spacing roles.

Stripe size PaymentSpace
xxsmall inline
xsmall related
small block
medium group
large section
xlarge, xxlarge major
Stripe radius PaymentRadius
none none
xsmall tag
small control
medium box
large sheet
rounded circle

Use theme.space to preserve the host base unit. The default gutter is 16 at every width. Nested radii must be concentric: inner rounding is smaller than outer rounding. Sections stay flat and separated by space.

Do: EdgeInsets.all(theme.space(PaymentSpace.group)), the named version of existing screen gutters. Don’t: EdgeInsets.all(16).

final theme = PaymentTheme.of(context);
final gutter = EdgeInsets.all(theme.space(PaymentSpace.group));

Size is small, medium (default), large; width is fill (default) or hug. All labels wrap. PaymentButton and fields already consume PaymentSize; interactive layout and hit boxes remain at least 48×48 dp regardless of visual size. PaymentBox implements token-based padding, gaps, radius and width.

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.

PaymentSize

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

Visual size only; layout box and hit area stay at least 48×48 dp. Components document their heights.

ValueDescription
smallModule headers, table or chip rows; never the main action.
mediumDefault, today's visual size.
largeOne primary action on a full-screen wide view.

PaymentWidth

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

Width policy; labels wrap and never truncate.

ValueDescription
fillParent width, the default.
hugContent width.

Use PaymentBox gap to space siblings from tokens. Fill needs a bounded parent; use hug inside a Row.