DocsCLI
init
Set up a project for SwipeUI.
npx @swipeui/cli init --theme defaultinit reads your project, shows every change it plans, and asks before writing. Running it again changes nothing that's already set up.
┌ 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
- 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. - Uniwind: installs
uniwindandtailwindcss, wrapsmetro.config.jswithwithUniwindConfig(creating Expo's default file if there's none), and importsglobal.cssfrom your root layout orApp.tsx. If your Metro config has a shape it doesn't recognise, it prints the exact change instead. - Theme: creates the owned
swipeui-theme.cssfile and imports it fromglobal.css, migrating recognized starter tokens and adding missing semantic roles.--themeselects a preset. See Using your existing theme. - Babel: checks the Reanimated worklets plugin and tells you if it's missing.
components.json: writes it, or adds the SwipeUI registries to an existing one. See Configuration.cn: adds the class-name helper..gitignore: ignores.env*.local.
Afterwards, restart Metro with a clear cache.