Color
Choose semantic colors from PaymentTheme so components share the host theme.
Which text color
Section titled “Which text color”Use the first row that matches:
| The text is… | Token |
|---|---|
| On a disabled control | disabled |
| A status word or status icon | tone(t).foreground |
| On an accent fill | onAccent |
| A label, caption or muted icon | textSecondary |
| Anything else | textPrimary |
Which line
Section titled “Which line”Use the first row that matches:
| The line is… | Token |
|---|---|
| How someone finds a control: an input, a secondary button or an unchecked box | border, at least 3:1 |
| The selected edge | accent |
| The focused edge | textPrimary ring (§3.8) |
| Anything else: it only separates content | outline, may be below 3:1 |
Tokens
Section titled “Tokens”| Token | Light | Dark | Use | Don't |
|---|---|---|---|---|
surface | #FFFFFF | #131417 | Page, sheets, dialogs and flat sections. | Do not box normal sections. |
surfaceMuted | #F5F6F8 | #1C1E23 | Disabled fills, skeletons and selected navigation. | Use only for this role. |
outline | #E3E6EC | #2C2E35 | Decorative separators; may be below 3:1. | Never use for a control edge. |
border | #868C9A | #7E838E | Control edges, at least 3:1 on surface. | Never use for decorative rules. |
textPrimary | #1A1F36 | #ECEDF0 | Titles, values, body and focus ring. | Use only for this role. |
textSecondary | #5E6678 | #A2A8B5 | Labels, captions and muted icons. | Use only for this role. |
disabled | #A6ABB5 | #62656E | Disabled text, icons and marks. | Do not replace with opacity. |
accent | #1A1F36 | #ECEDF0 | Primary fill, selected controls, links, focused input edge. | Do not use as a status color or focus ring. |
onAccent | #FFFFFF | #131417 | Text and icons on accent. | Use only for this role. |
neutral.foreground | #474747 | #C6C6C6 | Status words and icons. | Use only for this role. |
neutral.container | #E8E8E8 | #2A2A2A | Status fill paired with foreground, icon and text. | Use only for this role. |
info.foreground | #2A55A8 | #93B2F0 | Status words and icons. | Use only for this role. |
info.container | #EAEEF6 | #272D3A | Status fill paired with foreground, icon and text. | Use only for this role. |
success.foreground | #1D6B45 | #6FC79B | Status words and icons. | Use only for this role. |
success.container | #E8F0EC | #22312C | Status fill paired with foreground, icon and text. | Use only for this role. |
warning.foreground | #8A5300 | #E3A64C | Status words and icons. | Use only for this role. |
warning.container | #F3EEE6 | #342B1F | Status fill paired with foreground, icon and text. | Use only for this role. |
danger.foreground | #A8231C | #F2897F | Status words and icons. | Use only for this role. |
danger.container | #F6E9E8 | #372728 | Status fill paired with foreground, icon and text. | Use only for this role. |
Values are exported from the real Hairline theme in example/lib/themes.dart, in both brightness modes. Hosts override tokens through PaymentTheme.copyWith. Tone containers mix foreground toward surface by 90% in light mode and 84% in dark mode. Neutral follows the host scheme. Text must reach 4.5:1, control edges and meaningful marks 3:1. Decorative rules may recede below 3:1.
Do and don’t
Section titled “Do and don’t”Do: theme.border on an input edge, as in the existing controls. Don’t: theme.outline for that edge; it cannot identify a control at 3:1.
Raw-color exceptions
Section titled “Raw-color exceptions”Camera overlay: capture_widgets.dart:116,158 uses black54 and white over a host preview. Video controls/scrim: video.dart:282,296,301,312,315,326,365 uses white70, white, black54 and black over imagery. Side sheet: sheets.dart:192 uses black54 as its barrier. Transparent focus/surface tint entries remove Material fill rather than define a new color. No other raw-color styling is admitted.
D22 is implemented: toasts use textPrimary fill and surface text, with zero elevation.
Stripe text color mapping
Section titled “Stripe text color mapping”| Stripe | PaymentTextColor | Token |
|---|---|---|
| primary | primary |
textPrimary |
| secondary | secondary |
textSecondary |
| disabled | disabled |
disabled |
| brand | accent |
accent |
| info | info |
info.foreground |
| success | success |
success.foreground |
| attention | warning |
warning.foreground |
| critical | danger |
danger.foreground |
PaymentBox uses the theme’s semantic surfaces and PaymentKeyline options for outlines. See Box for its supported properties.
PaymentTheme
class PaymentTheme extends ThemeExtension<PaymentTheme> · lib/src/foundation/payment_theme.dart
Brand tokens for every rakit_ui widget.
Register it on ThemeData.extensions. Widgets fall back to PaymentTheme.fromColorScheme when no extension is installed, so the kit follows the host ColorScheme by default and a full brand is opt-in.
| Member | Type / value | Description |
|---|---|---|
accent | Color | |
onAccent | Color | |
surface | Color | |
surfaceMuted | Color | |
outline | Color | Hairline rule, decorative: dividers, the method-group edge and the action-bar top. It may sit below 3:1; control edges use border. |
textPrimary | Color | |
textSecondary | Color | |
neutral | ToneColors | |
info | ToneColors | |
success | ToneColors | |
warning | ToneColors | |
danger | ToneColors | |
radius | double | Corner radius of selectable boxes such as the method list (the box role). It is also the base of the other corner roles: tags use half of it, controls three quarters and sheets one and a half, unless tagRadius, controlRadius or sheetRadius sets that role (D101). |
tagRadius | double? | Corner radius of badges and tags. Null derives radius * 0.5. Zero gives square corners; a large value such as 999 gives pills. |
controlRadius | double? | Corner radius of buttons, inputs, notices and menus. Null derives radius * 0.75. |
sheetRadius | double? | Corner radius of sheet tops and dialogs. Null derives radius * 1.5. |
spacing | double | Base spacing unit. Kit widgets never multiply it by hand; they resolve a named role with space (D46), one value per role:* inline (4): label → caption, title → message, title → meta. * related (8): between actions and chips, text → trailing control. * block (12): icon → text, list row and header padding, notice padding. * group (16): screen, sheet and field gutters, label → value. * section (24): content → primary action, between field groups. * major (32): the largest gap; no kit widget uses it today. |
space | double | Resolves a semantic spacing role using this theme's base unit. |
amountWeight | FontWeight | |
amountFontFamily | String? | |
border | Color | Edge of a control: inputs, secondary buttons, unselected checkboxes. Unlike outline it must reach 3:1 against surface. Defaults to textSecondary a quarter of the way to surface. |
disabled | Color | Label and icon color of a disabled control, drawn on surfaceMuted. Defaults to textSecondary 45% of the way to surface. |
referenceFontFamily | String | Font for references people copy or compare: virtual account numbers, transaction IDs, promo codes. Defaults to the platform monospace. |
referenceFontFamilyFallback | List<String> | |
of | PaymentTheme | |
tone | ToneColors | |
borderRadius | BorderRadius | Selectable boxes such as the method list: radius. |
tagBorderRadius | BorderRadius | Badges and tags: tagRadius, else half of radius. |
controlBorderRadius | BorderRadius | Buttons, inputs, notices and menus: controlRadius, else three quarters of radius. |
sheetBorderRadius | BorderRadius | The top of a sheet and dialogs: sheetRadius, else one and a half times radius. |
amountStyle | TextStyle | Text style for amounts: the 32/36 display total when large, otherwise a 15/20 row amount. Both use amountWeight and tabular figures, and the host's font unless amountFontFamily is set. Same as PaymentType.of(context).display. |
| Parameter | Type | Default | Description |
|---|---|---|---|
accent:required | Color | — | — |
onAccent:required | Color | — | — |
surface:required | Color | — | — |
surfaceMuted:required | Color | — | — |
outline:required | Color | — | Hairline rule, decorative: dividers, the method-group edge and the action-bar top. It may sit below 3:1; control edges use border. |
textPrimary:required | Color | — | — |
textSecondary:required | Color | — | — |
neutral:required | ToneColors | — | — |
info:required | ToneColors | — | — |
success:required | ToneColors | — | — |
warning:required | ToneColors | — | — |
danger:required | ToneColors | — | — |
radius: | double | 8 | Corner radius of selectable boxes such as the method list (the box role). It is also the base of the other corner roles: tags use half of it, controls three quarters and sheets one and a half, unless tagRadius, controlRadius or sheetRadius sets that role (D101). |
tagRadius: | double? | — | Corner radius of badges and tags. Null derives radius * 0.5. Zero gives square corners; a large value such as 999 gives pills. |
controlRadius: | double? | — | Corner radius of buttons, inputs, notices and menus. Null derives radius * 0.75. |
sheetRadius: | double? | — | Corner radius of sheet tops and dialogs. Null derives radius * 1.5. |
spacing: | double | 8 | Base spacing unit. Kit widgets never multiply it by hand; they resolve a named role with space (D46), one value per role:* inline (4): label → caption, title → message, title → meta. * related (8): between actions and chips, text → trailing control. * block (12): icon → text, list row and header padding, notice padding. * group (16): screen, sheet and field gutters, label → value. * section (24): content → primary action, between field groups. * major (32): the largest gap; no kit widget uses it today. |
amountWeight: | FontWeight | FontWeight.w600 | — |
amountFontFamily: | String? | — | — |
border: | Color? | — | Edge of a control: inputs, secondary buttons, unselected checkboxes. Unlike outline it must reach 3:1 against surface. Defaults to textSecondary a quarter of the way to surface. |
disabled: | Color? | — | Label and icon color of a disabled control, drawn on surfaceMuted. Defaults to textSecondary 45% of the way to surface. |
referenceFontFamily: | String? | — | Font for references people copy or compare: virtual account numbers, transaction IDs, promo codes. Defaults to the platform monospace. |
PaymentTheme.fromColorScheme(…) — Derives tokens from a Material ColorScheme.
| Parameter | Type | Default | Description |
|---|---|---|---|
schemerequiredpositional | ColorScheme | — | — |
ToneColors
class ToneColors · lib/src/foundation/payment_theme.dart
Foreground/container pair for one StatusTone.
| Member | Type / value | Description |
|---|---|---|
foreground | Color | |
container | Color |
| Parameter | Type | Default | Description |
|---|---|---|---|
foreground:required | Color | — | — |
container:required | Color | — | — |
StatusTone
enum StatusTone · lib/src/foundation/payment_theme.dart
Semantic tone of a status. Widgets always pair a tone with an icon and a text label, so color is never the only signal.
| Value | Description |
|---|---|
neutral | — |
info | — |
success | — |
warning | — |
danger | — |
PaymentTextColor
enum PaymentTextColor · lib/src/foundation/payment_tokens.dart
Semantic text and icon colors.
| Value | Description |
|---|---|
primary | textPrimary. |
secondary | textSecondary. |
disabled | disabled. |
accent | accent. |
info | info.foreground. |
success | success.foreground. |
warning | warning.foreground. |
danger | danger.foreground. |