SwipeUI
DocsCLI

init

Set up a project for SwipeUI.

npx @swipeui/cli init --theme default

init reads your project, shows every change it plans, and asks before writing. Running it again changes nothing that's already set up.

Terminal
┌  swipeui init
◇  Expo SDK 58 · React Native 0.88.0 · pnpm · alias @/ → src/
◇  Theme: SwipeUI extras derived from your existing tokens
│  + components.json                   SwipeUI registries
│  ~ global.css                        18 SwipeUI tokens
│  = metro.config.js                   up to date
│  + src/components/swipeui/lib/cn.ts  cn@1.0.0
│  ↓ clsx@^2.1.1 tailwind-merge@^3.7.0   (npx expo install)
◆  Apply these changes?

+ creates a file, ~ updates one, = leaves it as it is, and ↓ installs packages.

What it does

  1. Detects the project: Expo or bare React Native, the SDK and React Native versions, the package manager, src/ and your tsconfig path alias. It stops in NativeWind projects.
  2. Uniwind: installs uniwind and tailwindcss, wraps metro.config.js with withUniwindConfig (creating Expo's default file if there's none), and imports global.css from your root layout or App.tsx. If your Metro config has a shape it doesn't recognise, it prints the exact change instead.
  3. Theme: creates the owned swipeui-theme.css file and imports it from global.css, migrating recognized starter tokens and adding missing semantic roles. --theme selects a preset. See Using your existing theme.
  4. Babel: checks the Reanimated worklets plugin and tells you if it's missing.
  5. components.json: writes it, or adds the SwipeUI registries to an existing one. See Configuration.
  6. cn: adds the class-name helper.
  7. .gitignore: ignores .env*.local.

Afterwards, restart Metro with a clear cache.

On this page