React Native

Use the SurfaceOne components in a React Native or Expo app, themed by the same tokens and skins.

@surface-one/react-native brings the components to iOS and Android. It uses the same Sone* names and the same props as the React package wherever they make sense on a phone, with the same roles, names and states for screen readers. React Native has no CSS, so every token is resolved ahead of time for each skin, colour mode and accent, and a provider hands the values to every component.

1. Install the packages

In an Expo app (SDK 53 or newer):

bash
npx expo install @surface-one/react-native react-native-svg

In a bare React Native app (0.78 or newer, with the New Architecture):

bash
npm install @surface-one/react-native react-native-svg

2. Wrap the app in the provider

tsx
import { SurfaceOneProvider, SoneButton } from "@surface-one/react-native";
import { surface } from "@surface-one/react-native/skins";

export default function App() {
  return (
    <SurfaceOneProvider skin={surface} colorMode="system" accent="teal">
      <SoneButton onPress={save}>Save</SoneButton>
    </SurfaceOneProvider>
  );
}
  • skin — surface, linen, studio, paper, minimalist or neumorphism, imported from @surface-one/react-native/skins. Each skin is its own module, so the app only bundles the skins it uses.
  • colorMode — light, dark or system (the default, which follows the device).
  • accent — blue, teal, green, orange or pink; leave it out for the skin's own accent.
  • tokens overrides single values, and messages translates the built-in strings.

The provider is optional: without it the components render Minimalist, light, in English.

Tokens in your own views

Every token keeps its CSS name in camelCase (--surface-raised → surfaceRaised, --space-4 → space4). Colours are strings, lengths are numbers in dp, and shadows are boxShadow strings:

tsx
import { View } from "react-native";
import { SoneText, useSoneStyles } from "@surface-one/react-native";

function Panel() {
  const s = useSoneStyles(({ tokens: t }) => ({
    box: {
      padding: t.space4,
      borderRadius: t.radiusLg,
      backgroundColor: t.surfaceRaised,
      borderWidth: t.borderWidthThin,
      borderColor: t.border,
    },
  }));
  return (
    <View style={s.box}>
      <SoneText tone="secondary">Every value is a token.</SoneText>
    </View>
  );
}

Fonts

By default the components use the platform font. To use the skin's families, load them first and then set fonts:

tsx
// Load the skin's families first (expo-font, @expo-google-fonts/*), then:
<SurfaceOneProvider skin={surface} fonts="skin">

What is different from the web

  • onPress replaces onClick, and style (merged last) replaces className.
  • Pressed states replace hover states. The focus ring shows for keyboard focus.
  • Dialogs and sheets are native modals: tapping the scrim or pressing the Android back button closes them.
  • Text inherits from its component: a string inside a button or a badge becomes its label, and SoneText and SoneIcon take the surrounding colour and size.
  • The device's reduce-motion setting stops spinners, skeletons and transitions.

Forms, overlays, display and data components are covered. The web-only families (sidebar, menus, tooltips, tables, markdown, flow, the AI chat and the editor) are not.