Skip to content
Get started
Menu
Get started

Color

Choose semantic colors from PaymentTheme so components share the host theme.

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

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
TokenLightDarkUseDon't
surface#FFFFFF#131417Page, sheets, dialogs and flat sections.Do not box normal sections.
surfaceMuted#F5F6F8#1C1E23Disabled fills, skeletons and selected navigation.Use only for this role.
outline#E3E6EC#2C2E35Decorative separators; may be below 3:1.Never use for a control edge.
border#868C9A#7E838EControl edges, at least 3:1 on surface.Never use for decorative rules.
textPrimary#1A1F36#ECEDF0Titles, values, body and focus ring.Use only for this role.
textSecondary#5E6678#A2A8B5Labels, captions and muted icons.Use only for this role.
disabled#A6ABB5#62656EDisabled text, icons and marks.Do not replace with opacity.
accent#1A1F36#ECEDF0Primary fill, selected controls, links, focused input edge.Do not use as a status color or focus ring.
onAccent#FFFFFF#131417Text and icons on accent.Use only for this role.
neutral.foreground#474747#C6C6C6Status words and icons.Use only for this role.
neutral.container#E8E8E8#2A2A2AStatus fill paired with foreground, icon and text.Use only for this role.
info.foreground#2A55A8#93B2F0Status words and icons.Use only for this role.
info.container#EAEEF6#272D3AStatus fill paired with foreground, icon and text.Use only for this role.
success.foreground#1D6B45#6FC79BStatus words and icons.Use only for this role.
success.container#E8F0EC#22312CStatus fill paired with foreground, icon and text.Use only for this role.
warning.foreground#8A5300#E3A64CStatus words and icons.Use only for this role.
warning.container#F3EEE6#342B1FStatus fill paired with foreground, icon and text.Use only for this role.
danger.foreground#A8231C#F2897FStatus words and icons.Use only for this role.
danger.container#F6E9E8#372728Status 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: 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.

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 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.

MemberType / valueDescription
accentColor
onAccentColor
surfaceColor
surfaceMutedColor
outlineColorHairline rule, decorative: dividers, the method-group edge and the action-bar top. It may sit below 3:1; control edges use border.
textPrimaryColor
textSecondaryColor
neutralToneColors
infoToneColors
successToneColors
warningToneColors
dangerToneColors
radiusdoubleCorner 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).
tagRadiusdouble?Corner radius of badges and tags. Null derives radius * 0.5. Zero gives square corners; a large value such as 999 gives pills.
controlRadiusdouble?Corner radius of buttons, inputs, notices and menus. Null derives radius * 0.75.
sheetRadiusdouble?Corner radius of sheet tops and dialogs. Null derives radius * 1.5.
spacingdoubleBase 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.

spacedoubleResolves a semantic spacing role using this theme's base unit.
amountWeightFontWeight
amountFontFamilyString?
borderColorEdge 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.
disabledColorLabel and icon color of a disabled control, drawn on surfaceMuted. Defaults to textSecondary 45% of the way to surface.
referenceFontFamilyStringFont for references people copy or compare: virtual account numbers, transaction IDs, promo codes. Defaults to the platform monospace.
referenceFontFamilyFallbackList<String>
ofPaymentTheme
toneToneColors
borderRadiusBorderRadiusSelectable boxes such as the method list: radius.
tagBorderRadiusBorderRadiusBadges and tags: tagRadius, else half of radius.
controlBorderRadiusBorderRadiusButtons, inputs, notices and menus: controlRadius, else three quarters of radius.
sheetBorderRadiusBorderRadiusThe top of a sheet and dialogs: sheetRadius, else one and a half times radius.
amountStyleTextStyleText 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.
ParameterTypeDefaultDescription
accent:requiredColor——
onAccent:requiredColor——
surface:requiredColor——
surfaceMuted:requiredColor——
outline:requiredColor—Hairline rule, decorative: dividers, the method-group edge and the action-bar top. It may sit below 3:1; control edges use border.
textPrimary:requiredColor——
textSecondary:requiredColor——
neutral:requiredToneColors——
info:requiredToneColors——
success:requiredToneColors——
warning:requiredToneColors——
danger:requiredToneColors——
radius:double8Corner 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:double8Base 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:FontWeightFontWeight.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.

ParameterTypeDefaultDescription
schemerequiredpositionalColorScheme——

ToneColors

class ToneColors · lib/src/foundation/payment_theme.dart

Foreground/container pair for one StatusTone.

MemberType / valueDescription
foregroundColor
containerColor
ParameterTypeDefaultDescription
foreground:requiredColor——
container:requiredColor——

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.

ValueDescription
neutral—
info—
success—
warning—
danger—

PaymentTextColor

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

Semantic text and icon colors.

ValueDescription
primarytextPrimary.
secondarytextSecondary.
disableddisabled.
accentaccent.
infoinfo.foreground.
successsuccess.foreground.
warningwarning.foreground.
dangerdanger.foreground.