theme
The theme prop on TaxKitProvider controls how the iframe renders visually. It takes three optional fields:
interface TaxKitTheme {
light?: ThemeContract;
dark?: ThemeContract;
mode?: 'light' | 'dark';
}
The ThemeContract field names (background, foreground, primary, muted / mutedForeground, accent, destructive, border, input, popover / popoverForeground, radius) match the canonical shadcn / Radix token contract. The iframe's UI is built on CoinTracker's @cointracker/base-ui, which is itself a shadcn-patterned library on top of Radix primitives — if you've worked with shadcn before, the semantics are identical. The ct*-prefixed fields are CoinTracker-specific surfaces with no shadcn equivalent; leave them unset for defaults.
Token values are any valid CSS color string (#0052FF, rgb(0, 82, 255), hsl(216 100% 50%), rgba(0, 82, 255, 0.8)). The iframe doesn't validate — an invalid string renders as the browser default.
Fields
theme.lightThemeContractColor and spacing tokens applied when the iframe renders in light mode. See ThemeContract below for the full token list.
theme.darkThemeContractColor and spacing tokens applied when the iframe renders in dark mode.
theme.mode'light' | 'dark'Force light or dark mode. When omitted, the iframe defaults to the user's OS preference (via prefers-color-scheme).
Example
<TaxKitProvider
fetchAccessToken={fetchAccessToken}
theme={{
mode: 'dark',
light: {
radius: '0.5rem',
spacing: '0.25rem',
fontSans: '"Inter", sans-serif',
background: 'rgb(255, 255, 255)',
foreground: 'rgb(10, 11, 13)',
primary: 'rgb(0, 82, 255)',
// …see ThemeContract for all available tokens
},
dark: {
radius: '0.5rem',
spacing: '0.25rem',
fontSans: '"Inter", sans-serif',
background: 'rgb(10, 11, 13)',
foreground: 'rgb(245, 248, 255)',
primary: 'rgb(55, 115, 245)',
},
}}
>
<YourApp />
</TaxKitProvider>
If your parent re-renders frequently, memoize the theme object (or its light/dark sub-objects) with useMemo — the provider already wraps the contract in useMemo internally, so stable references from your side avoid re-firing the dispatcher's CONFIG effect.
ThemeContract fields
Every field is optional. Unset tokens fall back to the iframe's defaults.
backgroundstringPage background color.
foregroundstringDefault text color on background.
primarystringBrand color used for primary buttons, focus rings, and emphasis.
secondarystringSecondary surface color (e.g. card backgrounds).
mutedstringMuted surface color for low-emphasis backgrounds.
mutedForegroundstringMuted text color for low-emphasis copy.
accentstringAccent surface color (used for hover/active states on neutral controls).
destructivestringColor for destructive actions and error states.
warningstringColor for warning states.
successstringColor for success states.
borderstringDefault border color.
inputstringBorder color for form inputs.
popoverstringPopover/modal background. Defaults to background when not provided.
popoverForegroundstringPopover/modal text color. Defaults to foreground when not provided.
radiusstringDefault border-radius for components.
buttonRadiusstringButton border-radius. Defaults to the Coinbase pill shape (9999px) when not provided.
cardRadiusstringCard/container border-radius. Defaults to 1rem (16px) when not provided.
spacingstringBase spacing unit.
fontSansstringSans-serif font stack.
ctCardSurfacestringCoinTracker-specific surface token used inside the kit.
ctForegroundstringCoinTracker-specific foreground token.
ctEmphasisstringCoinTracker-specific emphasis token.
ctSecondarystringCoinTracker-specific secondary token.