Installation
Initialize Moe UI in a TypeScript Next.js or Expo project.
Run the initializer from a Next.js or Expo application root:
pnpm dlx @moe-ui/cli@beta initIn an interactive terminal, choose a styling engine:
Choose a styling engine:
1. Uniwind (recommended)
2. NativeWind
Selection [1]:For automation, select it explicitly. --yes selects Uniwind for backwards compatibility.
pnpm dlx @moe-ui/cli@beta init --styling nativewind
pnpm dlx @moe-ui/cli@beta init --yesThe selection is stored in components.json. Rerunning init is idempotent, but the CLI does not automatically migrate an initialized project between styling engines.
Supported combinations
| Framework | Uniwind | NativeWind |
|---|---|---|
| Next.js 16 App Router | Tailwind CSS 4 | Tailwind CSS 4 |
| Expo / Expo Router | Tailwind CSS 4 | Tailwind CSS 4 |
NativeWind support targets the v5 preview. It requires React Native 0.81 or newer, the New Architecture for full support, and Reanimated 4. The initializer installs react-native-css, uses the CSS-first Tailwind 4 configuration, and pins Lightning CSS to the version required by NativeWind.
Next.js uses the existing Webpack-based React Native Web helper. Expo uses Metro and supports app/_layout.tsx, src/app/_layout.tsx, App.tsx, or src/App.tsx entry points.
What init changes
Every initialization creates components.json, the complete Moe UI light/dark token theme, and a small styling adapter used by shared registry source.
For Next.js, the CLI also:
- Composes
next.configwith the React Native Web aliases and extensions. - Adds
suppressHydrationWarningto the root App Router layout. - Configures Uniwind's Next plugin, or NativeWind's Tailwind 4 PostCSS integration.
For Expo, the CLI also:
- Creates or composes Metro configuration.
- Imports the generated root
global.cssfrom the detected application entry. - Configures Uniwind's Metro wrapper or NativeWind 5's Metro wrapper.
- Installs SDK-sensitive native packages through
expo install.
All required transformations are checked before files are changed. A custom config that cannot be composed safely produces an actionable error instead of a partial initialization.
Add a component
pnpm dlx @moe-ui/cli@beta add button dialogThe CLI resolves component and helper dependencies recursively, installs package dependencies, and writes source beneath the paths in components.json. Running the same command again is idempotent. Existing files are never silently replaced; review the conflict and rerun with --overwrite only when that is intentional.
Requirements
- Node.js 20.9 or newer
- TypeScript
- Next.js 16 App Router or Expo
- React 19
Other React Native bundlers can consume the same component source, but their bundler integration remains manual. See the CLI reference for flags and troubleshooting guidance.