Theming

Learn how to add your own branding to the UI Kit

The WDK React Native UI Kit provides a theming system that allows you to:

  • Use built-in themes for quick setup with light and dark modes

  • Create brand themes from your brand colors and fonts

  • Customize individual components with fine-grained control

  • Access theme values anywhere in your application

  • Switch themes dynamically based on user preferences


Basic Setup

Wrap your app with the ThemeProvider to enable theming:

Basic Theme Setup
import { ThemeProvider, lightTheme } from '@tetherto/wdk-uikit-react-native'

function App() {
  return (
    <ThemeProvider initialTheme={lightTheme}>
      {/* Your app content */}
    </ThemeProvider>
  )
}

The UI Kit comes with two built-in themes:


Manual Theme Control


Custom Themes

Brand Themes

Apply your brand colors and fonts using createThemeFromBrand:

BrandConfig Interface

Custom Theme

Create a completely custom theme with full control over all design tokens:

Theme Interface


Component Customization

You can customize the components with fine-grained control.

Fine-grained style overrides for specific component parts:

Set default visual variants per component:


Using Theme Anywhere

Access theme values anywhere in your components:

useTheme Hook


Theme Structure

Color Palette

The theming system uses semantic naming for colors:

Token
Purpose

colors.primary

Primary brand color

colors.primaryLight

Light variant of primary

colors.primaryDark

Dark variant of primary

colors.onPrimary

Text color on primary background

colors.secondary

Secondary brand color

colors.secondaryLight

Light variant of secondary

colors.secondaryDark

Dark variant of secondary

colors.background

Main background color

colors.surface

Card/container background

colors.surfaceVariant

Alternative surface color

colors.surfaceElevated

Elevated surface color

colors.text

Primary text color

colors.textSecondary

Secondary text color

colors.textDisabled

Disabled text color

colors.border

Border color

colors.borderLight

Light border color

colors.error

Error state color

colors.warning

Warning state color

colors.success

Success state color

colors.info

Info state color

Typography

Token
Purpose

typography.fontFamily.regular

Regular font family

typography.fontFamily.medium

Medium font family

typography.fontFamily.semiBold

Semi-bold font family

typography.fontFamily.bold

Bold font family

typography.fontSize.xs

Extra small font size (10px)

typography.fontSize.sm

Small font size (12px)

typography.fontSize.base

Base font size (14px)

typography.fontSize.md

Medium font size (16px)

typography.fontSize.lg

Large font size (18px)

typography.fontSize.xl

Extra large font size (20px)

typography.fontSize.xxl

2X large font size (24px)

typography.fontSize.xxxl

3X large font size (30px)

typography.fontWeight.regular

Regular font weight ('400')

typography.fontWeight.medium

Medium font weight ('500')

typography.fontWeight.semiBold

Semi-bold font weight ('600')

typography.fontWeight.bold

Bold font weight ('700')

Spacing

Token
Purpose

spacing.xs

Extra small spacing (4px)

spacing.sm

Small spacing (8px)

spacing.base

Base spacing (12px)

spacing.md

Medium spacing (16px)

spacing.lg

Large spacing (24px)

spacing.xl

Extra large spacing (32px)

spacing.xxl

2X large spacing (48px)

spacing.xxxl

3X large spacing (64px)

Border Radius

Token
Purpose

borderRadius.none

No border radius (0px)

borderRadius.sm

Small border radius (4px)

borderRadius.md

Medium border radius (8px)

borderRadius.lg

Large border radius (16px)

borderRadius.xl

Extra large border radius (24px)

borderRadius.xxl

2X large border radius (32px)

borderRadius.full

Full border radius (9999px)


Advanced Usage

Dynamic Theme Updates

Update themes dynamically at runtime:

Next Steps


Need Help?