Typography
Choose a PaymentType role for each text element. Roles inherit the host font and keep hierarchy consistent across components.
PaymentType.of(context) exposes nine roles. Every role inherits the host font from textTheme.bodyMedium; the kit bundles no fonts. Values below show size, line, weight and tracking.
| The text is… | Role |
|---|---|
| The one display amount | display |
| An action-bar total or a balance | amountLarge |
| A sheet or dialog title | title |
| A section or status title, or a button | heading |
| A paragraph | bodyFor(context) |
| A row label or value | label |
| A supporting line | caption |
| A short status | tag |
| A field entry | input |
The specimens below use the exported size, line height, weight and tracking in CSS pixels. They inherit the docs font; a Flutter host supplies its own font.
displayPayment received · 1,234.56amountLargePayment received · 1,234.56titlePayment received · 1,234.56headingPayment received · 1,234.56bodyPayment received · 1,234.56labelPayment received · 1,234.56captionPayment received · 1,234.56tagPayment received · 1,234.56inputPayment received · 1,234.56| Token | Value | Use | Don't |
|---|---|---|---|
display | 32 / 36 · weight 600 · tracking -0.32 | One display amount per screen. | Never two on one screen. |
amountLarge | 20 / 28 · weight 600 · tracking 0 | Action-bar total, balance, VA number, entered amount. | Not row amounts. |
title | 17 / 24 · weight 600 · tracking 0 | Sheet, dialog and app-bar title. | Not section titles. |
heading | 15 / 20 · weight 600 · tracking 0 | Section and status titles, Total row, buttons. | Not paragraphs. |
body | 15 / 22 · weight 400 · tracking 0 | Paragraphs; bodyFor tightens leading above 1.5×. | Not single-line rows. |
label | 15 / 20 · weight 400 · tracking 0 | Row labels, values, tabs and row amounts. | Not paragraphs. |
caption | 13 / 18 · weight 400 · tracking 0 | Supporting lines, helper text, meta, legends. | Not essential action instructions. |
tag | 12 / 16 · weight 600 · tracking 0 | Badge or copy feedback, at most three words. | Not more than three words. |
input | 16 / 24 · weight 400 · tracking 0 | Text inside fields. | Not field labels. |
Modifiers
Section titled “Modifiers”Use type.tabular(style) for changing or aligned numbers. Use type.reference(style) for VA numbers, transaction IDs and promo codes: it adds tabular figures in the host reference font (Menlo, monospace, Courier fallback). PaymentType has no weight modifier; choose heading instead of label for hierarchy. Hosts may set amountWeight, amountFontFamily and referenceFontFamily.
Do: PaymentType.of(context).caption, as the existing rows do. Don’t: TextStyle(fontSize: 13), which loses host font and semantic intent.
final type = PaymentType.of(context);final rowAmount = type.tabular(type.label);final reference = type.reference(type.label);SizedBox( height: PaymentType.firstLineHeight(context), child: const Center(child: Icon(PaymentIcons.info)),);Above 1.5×, rows wrap values and bodyFor uses 1.3 leading. At 200%, titles still wrap. Amounts at 20 and above and adjacent medium icons clamp at 1.6×; amounts scale down rather than hide digits. Use sentence case, specific copy and put key words first. Never truncate an action label.
Stripe mapping
Section titled “Stripe mapping”| Stripe font | PaymentTextRole |
|---|---|
| title | title |
| subtitle, heading, subheading | heading |
| lead, body | body |
| bodyEmphasized | body + semibold |
| caption | caption |
| kicker | tag |
PaymentFontWeight provides regular (400), semibold (600) and bold (700) emphasis for PaymentInline and PaymentSpan. Use bold for emphasis within running text; choose a type role for headings.
Migration
Section titled “Migration”theme.amountStyle(context) remains the display alias. The deprecated large parameter becomes type.tabular(type.label) for row amounts; choose type.tabular(type.heading) only when preserving the old 600 weight is required.
PaymentType
class PaymentType · lib/src/foundation/payment_type.dart
Public type foundation: nine closed roles, seven sizes and two weights. Every role inherits the host font. Choose a role for hierarchy; there is no weight modifier. Use tabular for numbers and reference for IDs.
| Member | Type / value | Description |
|---|---|---|
isLarge | bool | Whether text is scaled above 1.5×, where rows wrap and paragraphs tighten their leading. |
firstLineHeight | double | Height of one 15/20 heading or label line at the current text scale. Center leading icons in a box this tall when text wraps. |
tabular | TextStyle | style with tabular figures. |
reference | TextStyle | style with tabular figures in PaymentTheme.referenceFontFamily. |
display | TextStyle | The one display amount per screen: 32/36, tracking −0.32. |
amountLarge | TextStyle | Action-bar total, balance, VA number, entered amount: 20/28. |
title | TextStyle | Sheet, dialog and app-bar titles: 17/24 w600. |
heading | TextStyle | Section and status titles, the Total row, buttons: 15/20 w600. |
body | TextStyle | Paragraphs: 15/22. Use bodyFor so leading tightens at large text. |
label | TextStyle | Single-line row text, labels and values: 15/20. |
caption | TextStyle | Supporting lines under a title: 13/18, muted. |
tag | TextStyle | Badges and tags: 12/16 w600. No color; the tone sets it. |
input | TextStyle | Text fields: 16/24. |
bodyFor | TextStyle | body, with 1.3 leading above 1.5× text so long paragraphs stay short. |
PaymentType.of(…) — Resolves the nine roles from the ambient host font and payment theme.
| Parameter | Type | Default | Description |
|---|---|---|---|
contextrequiredpositional | BuildContext | — | — |
PaymentTextRole
enum PaymentTextRole · lib/src/foundation/payment_tokens.dart
The nine PaymentType roles; no additional role exists.
| Value | Description |
|---|---|
display | display: one display amount. |
amountLarge | amountLarge: totals and balances. |
title | title: sheet and app-bar titles. |
heading | heading: section titles. |
body | bodyFor(context): paragraphs. |
label | label: row labels and values. |
caption | caption: supporting text. |
tag | tag: short status words. |
input | input: field text. |
PaymentFontWeight
enum PaymentFontWeight · lib/src/foundation/payment_tokens.dart
Running-text emphasis only; choose a PaymentType role for hierarchy.
| Value | Description |
|---|---|
regular | FontWeight.w400. |
semibold | FontWeight.w600. |
bold | FontWeight.w700; emphasis inside running text only. |
Layout foundation
Section titled “Layout foundation”PaymentInline and PaymentSpan apply the closed role and emphasis vocabulary to running text.