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):
npx expo install @surface-one/react-native react-native-svgIn a bare React Native app (0.78 or newer, with the New Architecture):
npm install @surface-one/react-native react-native-svg2. Wrap the app in the provider
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,minimalistorneumorphism, imported from@surface-one/react-native/skins. Each skin is its own module, so the app only bundles the skins it uses.colorMode—light,darkorsystem(the default, which follows the device).accent—blue,teal,green,orangeorpink; leave it out for the skin's own accent.tokensoverrides single values, andmessagestranslates 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:
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:
// Load the skin's families first (expo-font, @expo-google-fonts/*), then:
<SurfaceOneProvider skin={surface} fonts="skin">What is different from the web
onPressreplacesonClick, andstyle(merged last) replacesclassName.- 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
SoneTextandSoneIcontake 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.