SwipeUI
DocsGetting started

Bare React Native app

Add SwipeUI to an app created with the React Native CLI.

You need React Native 0.82 or later and Node 20.12 or later.

Install Expo modules

Some items use Expo packages such as expo-haptics. If your app doesn't have Expo modules yet:

npx install-expo-modules@latest

With Expo modules installed, the CLI installs packages with npx expo install, which picks versions that match your SDK.

Set up the project

npx @swipeui/cli init

init installs Uniwind, adds the SwipeUI tokens to global.css, imports it from App.tsx, adds cn, and wraps the module.exports line of metro.config.js with withUniwindConfig. If your Metro config has a shape it doesn't recognise, it prints the exact line to change instead of guessing.

Check the Babel config

Reanimated 4 needs the worklets Babel plugin. babel-preset-expo adds it for you; with @react-native/babel-preset, add it as the last plugin:

babel.config.js
module.exports = {
  presets: ['module:@react-native/babel-preset'],
  plugins: ['react-native-worklets/plugin'],
};

Add components and rebuild

npx @swipeui/cli add button switch list-row

If the CLI installed native packages (it says so), run pod install in ios/ and rebuild the app.

Imports

Metro only reads tsconfig path aliases when Expo's CLI starts it, and bare apps start Metro with react-native start. So the CLI writes relative imports between SwipeUI files. Import the components the same way:

App.tsx
import './global.css';
import { Button } from './src/components/swipeui/ui/button';

The Expo guide's settings screen works unchanged apart from those import paths.

Gotchas

  • Styles missing: App.tsx must import global.css, and metro.config.js must keep withUniwindConfig as the outermost wrapper. Restart Metro with npx react-native start --reset-cache.
  • npx @swipeui/cli doctor checks the Uniwind setup, the worklets plugin and every package your SwipeUI files import.

On this page