Skip to Content
ARCUI

Provider

Configure ARCUI theme mode, design tokens, strings, icons, safe area, back behavior, and shared runtime infrastructure.

ARCUI is the public root provider for the library runtime.

import { ARCUI } from "react-native-arc-ui";

export default function App() {
  return <ARCUI>{/* application */}</ARCUI>;
}

Most applications should mount one provider near the application root.

Theme mode

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

system is the default. ARCUI resolves it to light or dark, then animates the shared theme progress when the system Reduced Motion preference allows it.

Static theme meaning and animated visual progress are deliberately separate public concepts.

Theming →

Tokens are mount-time design-system configuration

import { ARCUI, defaultTokens, type TTokensOverride } from "react-native-arc-ui";

const tokens = {
  spacing: {
    ...defaultTokens.spacing,
    l: 24,
  },
} satisfies TTokensOverride;

<ARCUI tokens={tokens}>{/* application */}</ARCUI>;

Token configuration is resolved once per provider mount.

Overrides are shallow at the top level: providing spacing, typography, radius, or any other built-in namespace replaces that complete namespace. Compose nested changes explicitly with normal object spread.

Tokens →

Strings are runtime-reactive

Reusable ARCUI-owned behavior and accessibility strings are configured separately from design tokens:

<ARCUI
  strings={{
    headerBackAccessibilityLabel: "Back",
    modalCloseAccessibilityLabel: "Close",
    selectSearchPlaceholder: "Search",
  }}
>
  {/* application */}
</ARCUI>

strings may update without remounting the provider.

Localization →

Icon registry

iconSet configures the provider-wide icon registry used by Icon and ARCUI-owned icon consumers.

import { ARCUI, defaultIcons, type TIconSet } from "react-native-arc-ui";

const iconSet = {
  ...defaultIcons,
  // application icons
} satisfies TIconSet;

<ARCUI iconSet={iconSet}>{/* application */}</ARCUI>;

The registry is resolved once per provider mount.

ARCUI's required default icon names must still exist in the configured registry. Missing required icons are a configuration invariant and fail clearly rather than silently degrading.

Icon →

Shared back behavior

Provide onBack when supported components such as Header should share an application-level back action:

<ARCUI onBack={() => navigation.goBack()}>
  {/* application */}
</ARCUI>

A component-level back callback remains the local override where the component contract exposes one.

Gesture Handler ownership

ARCUI wraps its subtree in GestureHandlerRootView by default:

<ARCUI gestureHandlerRootView>{/* application */}</ARCUI>

If the application already owns a higher Gesture Handler root, disable ARCUI's wrapper:

<ARCUI gestureHandlerRootView={false}>{/* application */}</ARCUI>

This is ownership configuration, not a performance switch.

Safe-area information

ARCUI accepts runtime device insets from the application:

<ARCUI
  safeAreaInsets={{
    top: insets.top,
    right: insets.right,
    bottom: insets.bottom,
    left: insets.left,
  }}
>
  {/* application */}
</ARCUI>

Missing edges default to 0; negative values are clamped to 0.

Safe-area-aware ARCUI components combine these runtime values with the policy in tokens.safeArea.

Safe area & overlays →

Provider-owned overlays

The root provider owns one predictable floating-UI hierarchy:

Application
-> Modal
-> Dropdown
-> Toast
-> Dialog backdrop
-> Dialog

Do not mount ARCUI's private overlay providers yourself.

Modal, Dropdown, and Dialog also manage accessibility isolation so background application content does not remain reachable as though it were active foreground UI.

Lifecycle summary

Provider inputLifecycle
themeRuntime-reactive.
tokensResolved once per provider mount.
stringsRuntime-reactive.
iconSetResolved once per provider mount.
onBackRuntime-reactive through provider context.
safeAreaInsetsRuntime-reactive and normalized per edge.
gestureHandlerRootViewStructural provider ownership choice.

Public props

PropTypeDefaultPurpose
childrenReactNoderequiredApplication subtree.
theme"system" | "light" | "dark""system"Theme ownership mode.
tokensTTokensOverride<TCustom>defaultsComplete top-level token namespaces plus optional custom namespaces.
stringsTARCUIStringsOverridedefaultsPartial runtime-reactive ARCUI-owned strings.
iconSetTIconSetdefaultIconsProvider-wide icon registry.
onBack() => void—Shared back action used by supported controls.
gestureHandlerRootViewbooleantrueWhether ARCUI owns GestureHandlerRootView.
safeAreaInsetsPartial<TSafeAreaInsets>all 0Runtime device insets supplied by the application.

On this page