Skip to Content
ARCUI

ThemedView

Theme-aware ARCUI View surface with explicit background-color ownership and native View composition.

ThemedView is a native View whose background can interpolate with ARCUI's active theme while all other layout/styling remains normal React Native composition.

Open ThemedView in Expo Snack ↗

Usage

import { Text, ThemedView } from "react-native-arc-ui";

<ThemedView style={{ padding: 16, borderRadius: 12 }}>
  <Text>Theme-aware surface</Text>
</ThemedView>;

Background ownership

The background priority is:

color
-> complete darkColor + lightColor pair
-> style.backgroundColor
-> colors.*.themedView.background

Fixed color

<ThemedView color="rgba(20,20,20,1)" />

color wins in both themes.

Theme-aware pair

<ThemedView
  darkColor="rgba(20,20,20,1)"
  lightColor="rgba(250,250,250,1)"
/>

Both values must be present for the pair to own the background. If only one is supplied, ARCUI falls back to its normal themed-view tokens.

Native style-owned background

<ThemedView style={{ backgroundColor: "tomato" }} />

When neither color nor a complete theme pair owns the background, style.backgroundColor remains fully consumer-owned and ARCUI intentionally does not create a competing animated background property.

Composition

All non-background style fields remain normal native View styling:

<ThemedView
  style={{
    padding: 20,
    borderRadius: 16,
    gap: 12,
  }}
>
  {children}
</ThemedView>

Use ThemedView when theme-aware surface color is the requirement. Use a regular View when no ARCUI color ownership is needed.

ReverseTheme

ThemedView automatically consumes the current ARCUI theme context, including a reversed subtree:

<ReverseTheme>
  <ThemedView>
    <Text>Rendered against the opposite theme context.</Text>
  </ThemedView>
</ReverseTheme>

No special prop is required on the view itself.

Ref and native View props

ARCUI uses React 19 ref-as-prop and exposes the underlying native View. IThemedView otherwise inherits normal ViewProps, including testID, accessibility props, pointer events, layout callbacks, and style composition.

Testing

Use native testID on the root. There are no private ThemedView descendant identifiers.

API Reference

Also inherits: ViewProps

PropTypeDefaultDescription
children?ReactNode——
ref?Ref<View>—React 19 ref-as-prop. Exposes the underlying native View for measurement and other standard React Native imperative APIs.
color?string—Fixed background color used in both themes. Takes priority over darkColor/lightColor and style.backgroundColor.
darkColor?string—Dark-theme background color override. Used only when lightColor is also provided.
lightColor?string—Light-theme background color override. Used only when darkColor is also provided.

Generated from the ARCUI 1.1.x TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.

Motion

When ARCUI owns the background color, light/dark interpolation follows the animated theme SharedValue on the UI thread. If native style.backgroundColor owns the property, no competing animated color is emitted.

Performance

The component flattens the incoming style once during React render to decide who owns backgroundColor. Continuous theme interpolation stays in Reanimated and does not require frame-by-frame React state.

Accessibility

ThemedView does not assign a role or create duplicate accessible content. Native View accessibility props remain available for application-specific semantics.

Theming

The dedicated token surface is:

colors.*.themedView.background

Theme motion itself follows ARCUI's animated theme system. Instance props are best reserved for true local exceptions rather than replacing design-system tokens everywhere.

On this page