Skip to Content
ARCUI

Theming

ARCUI light, dark, and system theme ownership, animated theme progress, and theme-aware composition.

ARCUI supports three provider modes:

<ARCUI theme="system">{/* application */}</ARCUI>
<ARCUI theme="light">{/* application */}</ARCUI>
<ARCUI theme="dark">{/* application */}</ARCUI>

system is the default.

Static meaning and animated progress are separate

ARCUI exposes two complementary public views of theme state:

const { theme, themeMode, tokens } = useARCUITheme();
const { themeProgress } = useARCUIAnimatedTheme();

Use theme and themeMode for React render-time meaning or structure.

Use themeProgress only when a custom visual needs continuous interpolation in Reanimated:

0 -> dark
1 -> light

Do not read themeProgress.value during normal React render.

Theme-aware color ownership

ARCUI 2.0.0 uses strongly typed per-component colors objects. Each slot accepts a fixed string or a complete { light, dark } pair and can be overridden independently. Components with semantic meaning may also expose tone.

For components such as Text and ThemedView, the model is conceptually:

colors.<slot> (fixed string or complete light/dark pair)
-> semantic tone/component state where supported
-> native style color/backgroundColor when it is the owning escape hatch
-> ARCUI token default

The native style escape hatch is evaluated only for the property it owns when the matching colors slot is absent; semantic defaults and token fallbacks remain component-specific. A complete light/dark pair can interpolate continuously with the shared theme progress.

<Text colors={{ text: { light: "rgba(17,17,17,1)", dark: "rgba(250,250,250,1)" } }}>
  Theme aware
</Text>

<ThemedView colors={{ background: "rgba(20,20,20,1)" }} />

Colors API → · Text → · ThemedView →

Custom theme-aware visuals

A custom visual can reuse ARCUI's tokens and animated progress without creating a parallel theme system:

import {
  interpolateColor,
  useAnimatedStyle,
} from "react-native-reanimated";
import {
  useARCUIAnimatedTheme,
  useARCUITheme,
} from "react-native-arc-ui";

const { tokens } = useARCUITheme();
const { themeProgress } = useARCUIAnimatedTheme();

const animatedStyle = useAnimatedStyle(() => ({
  backgroundColor: interpolateColor(
    themeProgress.value,
    [0, 1],
    [
      tokens.colors.dark.background.screen,
      tokens.colors.light.background.screen,
    ],
  ),
}));

Extract reusable token primitives before worklets where practical instead of repeatedly traversing large token objects inside frame-level code.

Reverse a subtree, not individual colors

Use ReverseTheme when a complete subtree should behave as the opposite ARCUI theme:

<ReverseTheme>
  <ThemedView>
    <Text>Opposite theme</Text>
  </ThemedView>
</ReverseTheme>

ReverseTheme derives 1 - themeProgress on the UI thread. It does not create a second provider or duplicate tokens/system state.

ReverseTheme →

Tokens vs instance props

Use tokens for application-wide design decisions:

const tokens = {
  radius: {
    ...defaultTokens.radius,
    button: 14,
  },
} satisfies TTokensOverride;

Use documented component props or native style escape hatches for intentional local exceptions:

<Button radius={0}>One square Button</Button>

System theme changes

When theme="system", ARCUI follows the platform appearance reactively. If the platform temporarily reports no color scheme, ARCUI resolves to light mode.

Theme animation still respects the system Reduced Motion preference.

On this page