Custom tokens

Override any token in native-mate.json without touching component source. Changes apply instantly on hot reload.

Override colours

native-mate.json
1
2
3
4
5
6
7
8
9
10
11
{
  "preset": "zinc",
  "componentsDir": "components/ui",
  "tokens": {
    "colors": {
      "primary": "#6366f1",
      "primaryForeground": "#ffffff",
      "destructive": "#dc2626"
    }
  }
}

Override spacing and radius

json
1
2
3
4
5
6
7
8
{
  "preset": "zinc",
  "componentsDir": "components/ui",
  "tokens": {
    "spacing": { "lg": 20, "xl": 28 },
    "radius": { "md": 6, "lg": 12 }
  }
}

Programmatic overrides

Pass overrides directly to ThemeProvider for runtime switching (e.g. white-label brands):

tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { ThemeProvider } from '@native-mate/core'

const BRAND_TOKENS = {
  colors: {
    primary: '#0f766e',
    primaryForeground: '#ffffff',
  },
}

export function App() {
  return (
    <ThemeProvider preset="zinc" overrides={BRAND_TOKENS}>
      <RootNavigator />
    </ThemeProvider>
  )
}

Available colour tokens

TokenPurpose
backgroundScreen/page background
surfaceCard, input, sheet background
surfaceRaisedElevated card, popover background
borderDividers, input borders
foregroundPrimary text
mutedForegroundSecondary text, placeholders
primaryBrand/action colour (buttons, links)
primaryForegroundText on primary background
destructiveErrors, delete actions
destructiveForegroundText on destructive background
successSuccess states
successForegroundText on success background
warningWarning states
warningForegroundText on warning background
mutedMuted/disabled fill
overlayModal backdrop scrim
ringFocus ring colour