Magic Native UI

Installation

Magic Native UI requires Expo SDK 57 or newer, React 19 and Tailwind CSS v4.

expo@>=57react-native@>=0.86react@19tailwindcss@4
1

Run init

This writes components.json, creates your Tailwind entry stylesheet with the theme tokens, configures Metro for Uniwind and installs the base dependencies.

Terminal
npx magic-native-ui@latest init
2

Import the stylesheet

Import the stylesheet in your root layout — not in index.js, which breaks fast refresh. Overlays such as Dialog need no host component: they render in a React Native modal.

app/_layout.tsx
import '../global.css'

import { Stack } from 'expo-router'
import { SafeAreaProvider } from 'react-native-safe-area-context'

export default function RootLayout() {
  return (
    <SafeAreaProvider>
      <Stack />
    </SafeAreaProvider>
  )
}
3

Add components

Each component is copied into your project along with anything it depends on.

Terminal
npx magic-native-ui@latest add button dialog card
4

Switch themes

Themes are Uniwind variants rather than a class on the root element, so there is no provider to add. Dark mode follows the device by default.

theme.ts
import { Uniwind } from 'uniwind'

Uniwind.setTheme('dark')   // or 'light', or 'system'