Docs

Theming

Switch light, dark or system instantly, or swap the whole look with a theme variant. Native-UI ships two: Aurora (the original) and Bloom (soft, rounded, violet). Each variant carries its own accent presets, customAccent overrides a single colour, and theme.components overrides the tokens of any component. You only pass what changes.

import { NativeUIProvider, bloomFontFamilies } from '@polprog/native-ui';

export default function App() {
  return (
    <NativeUIProvider
      config={{
        theme: 'bloom',        // 'default' (Aurora) | 'bloom'
        colorMode: 'system',   // 'light' | 'dark' | 'system'
        preset: 'violet',      // accent preset for the active variant
        fontFamilies: bloomFontFamilies,
      }}
    >
      <Root />
    </NativeUIProvider>
  );
}

Accent presets

Aurora

theme: 'default'
  • default Default #00E67A
  • midnight #818CF8
  • ocean #38BDF8
  • forest #34D399
  • sunset #FB923C
  • rose #EC4899
  • amoled #94A3B8
Preview Active

Bloom

theme: 'bloom'
  • violet Default #7C5CFF
  • grape #8B54E8
  • coral #FF5D7D
  • ocean #2F9BFF
Preview Active

Key points

  • Two variants ship with the library: Aurora (theme: 'default') and Bloom (theme: 'bloom').
  • colorMode is light, dark or system. System follows the device setting.
  • preset picks an accent preset of the active variant and customAccent replaces the accent with one colour of your own.
  • The components key overrides the tokens of a single component and leaves the rest untouched.

Full reference in Storybook

← Back to getting started

Expo React Native 0.84+ iOS Android TypeScript Accessible