Skip to main content

Quick Start

Add Vortex Native to an existing React Native app.

Starting a new app? Follow the React Native guide or the Expo guide.

Install the packages

Vortex packages are private and available by invitation. Before installing, accept your package-access invitation and authenticate your package manager with the npm account that received access. See the package access terms.

Install Vortex Native and its required Vortex Themes peer dependency. Vortex Native has no native code, so you don't need to install pods.

bun add @vortexlabs/vortex-native @vortexlabs/vortex-themes

When upgrading Vortex Native, review the release notes for breaking changes and compatibility requirements.

Generate your theme

Create vortex-native.config.ts at your project root. Replace acme with your theme name; an empty definition inherits Vortex's defaults.

vortex-native.config.ts
import type { VortexNativeThemeConfig } from "@vortexlabs/vortex-themes";

const config: VortexNativeThemeConfig = {
  themes: {
    acme: {},
  },
};

export default config;

Add a script to your existing package.json. The CLI is included in @vortexlabs/vortex-themes.

package.json
"scripts": {
  "build:theme": "vortex-themes theming --platform native --output ./src/themes"
}
bun run build:theme

This creates src/themes/acme/theme.native.ts. Run the script again after changing vortex-native.config.ts or upgrading Vortex Native or Vortex Themes.

To start without a config, import a bundled theme instead, such as @vortexlabs/vortex-themes/themes/vortex/native.

Add the provider

Wrap your app in VortexProvider and pass it the theme. defaultColorMode="system" follows the device setting.

The provider doesn't paint the screen. Add a surface that applies the theme background and status bar style, and keep content inside the safe area with react-native-safe-area-context. Install it if your app doesn't have it yet.

App.tsx
import { useTheme, VortexProvider } from "@vortexlabs/vortex-native";
import type { ReactNode } from "react";
import { StatusBar, View } from "react-native";
import { SafeAreaProvider, useSafeAreaInsets } from "react-native-safe-area-context";
import acmeTheme from "./src/themes/acme/theme.native";
import HomeScreen from "./src/HomeScreen";

const AppSurface = ({ children }: { children: ReactNode }) => {
  const { theme, colorMode } = useTheme();
  const insets = useSafeAreaInsets();

  return (
    <View
      style={{
        flex: 1,
        backgroundColor: theme.color[colorMode].backgroundDefault,
        paddingTop: insets.top,
        paddingBottom: insets.bottom,
      }}
    >
      <StatusBar barStyle={colorMode === "dark" ? "light-content" : "dark-content"} />
      {children}
    </View>
  );
};

const App = () => (
  <SafeAreaProvider>
    <VortexProvider theme={acmeTheme} defaultColorMode="system">
      <AppSurface>
        <HomeScreen />
      </AppSurface>
    </VortexProvider>
  </SafeAreaProvider>
);

export default App;

The surface extends the background behind the status bar and home indicator, while the padding keeps content clear of them.

Use a component

Render this screen inside the provider:

import { Stack, Text } from "@vortexlabs/vortex-native";

const HomeScreen = () => (
  <Stack gap={2} padding={4}>
    <Text size="heading-xl">Hello Vortex</Text>
    <Text color="subtle">Built with Vortex Native.</Text>
  </Stack>
);

export default HomeScreen;

Fonts

Vortex Native doesn't load font files. The Vortex theme uses Hellix for headings and Inter for body text; until your app bundles fonts registered under those family names, text falls back to the system font. Follow the Fonts guide to add them or use your own.