Skip to Content
ARCUI

Safe area & overlays

Feed runtime safe-area insets into ARCUI and use the provider-owned overlay hierarchy for floating UI.

ARCUI separates runtime device geometry from design-system safe-area policy.

That same provider also owns the shared floating-UI hierarchy used by Modal, Dropdown, Toast, and Dialog.

Runtime insets come from the application

Supply the application's current inset values to the root provider:

import { SafeAreaProvider, useSafeAreaInsets } from "react-native-safe-area-context";
import { ARCUI } from "react-native-arc-ui";

function AppContent() {
  const safeAreaInsets = useSafeAreaInsets();

  return (
    <ARCUI theme="system" safeAreaInsets={safeAreaInsets}>
      {/* Your application */}
    </ARCUI>
  );
}

export default function App() {
  return (
    <SafeAreaProvider>
      <AppContent />
    </SafeAreaProvider>
  );
}

In Expo, install react-native-safe-area-context with npx expo install react-native-safe-area-context if needed. The hook reads values from its nearest SafeAreaProvider, so it must be used below that provider. Reuse the application's existing provider when present; ARCUI can also accept inset values from another app-owned source.

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

ARCUI does not require a second safe-area package internally. Feed it values from whichever safe-area source the application already owns.

tokens.safeArea defines policy

Runtime insets answer what the device geometry is.

Safe-area tokens answer how each ARCUI surface should use it.

Per edge:

false -> ignore the device inset
0     -> use the device inset only
N     -> use device inset + N

The built-in groups are:

screen
header
modal
dropdown
toast
dialog

Example default behavior:

  • Screen.top = 0 means use the device top inset exactly;
  • Modal.bottom = 16 means bottom inset plus 16 points;
  • Toast.top = 16 means top inset plus 16 points;
  • an edge configured as false ignores that device inset for that component.

Tokens →

Provider-owned overlay order

ARCUI owns one predictable visual hierarchy:

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

This avoids competing local roots and lets ARCUI coordinate:

  • z-index/elevation;
  • safe-area positioning;
  • presentation/dismissal lifecycle;
  • background pointer interaction;
  • assistive-technology isolation.

Do not mount ARCUI's internal host/provider components manually.

const [visible, setVisible] = useState(false);

<Modal
  visible={visible}
  onClose={() => setVisible(false)}
>
  <Content />
</Modal>

The React declaration owns visible. ARCUI rehosts the visual Modal content into the root provider's Modal layer.

Because of that rehosting, React Context providers mounted below <ARCUI /> are not guaranteed to remain ancestors of Modal content. Put required shared context above ARCUI or pass the required values explicitly through application composition.

Modal →

Dropdown measures/anchors from its trigger while rendering its visual overlay through the shared provider layer.

While a Dropdown is presented, underlying application interaction is disabled and background content is hidden from assistive-technology traversal.

Dropdown →

Toast and Dialog are imperative global feedback

Toast:

const id = showToast({ message: "Saved" });
hideToast(id);

Dialog:

showDialog({
  title: "Delete item?",
  actions: [
    { label: "Cancel", type: "border" },
    { label: "Delete", type: "solid", tone: "danger", onPress: removeItem },
  ],
});

Both APIs require a mounted ARCUI provider because the provider owns the global lifecycle controller.

Toast → · Dialog →

Accessibility isolation is semantic, not animated

Modal/Dropdown/Dialog background isolation follows the actual presented lifecycle managed by React/provider state.

It does not infer “open” from an animation SharedValue.

That distinction keeps screen-reader state stable while visual entry/exit motion runs independently.

On this page