stratum-uikit init
stratum-uikit init scaffolds all Stratum infrastructure into an existing Expo project — design tokens, theme files, ThemeProvider, and hooks.
npx stratum-uikit initRun this from your project root (the directory containing package.json).
What it does
Section titled “What it does”- Checks that
package.jsonexists in the current directory (bails if not) - Detects Expo in your dependencies — warns if not found but continues
- Writes
stratum.config.jsonto your project root with default directory paths - Copies token files into
src/tokens/:colors.ts,spacing.ts,typography.ts,radii.ts,shadows.ts,borders.tstheme-protocol.ts— theAppThemeinterface all themes implementindex.ts— barrel exportthemes/registry.ts,themes/createTheme.ts,themes/slate.ts
- Copies providers into
src/providers/:ThemeProvider.tsx— wrap your app root in thisunistyles.ts— Unistyles config (auto-derived from THEME_REGISTRY)
- Copies hooks into
src/hooks/:useTheme.ts—const theme = useTheme()useThemeToggle.ts—const { setTheme, toggleColorScheme } = useThemeToggle()
- Prints next steps
What it does NOT do
Section titled “What it does NOT do”- Does not run
npm installorexpo install(package managers vary — follow the printed instructions) - Does not modify
tsconfig.json(add the@/alias yourself — see below) - Does not modify your root layout (follow the printed ThemeProvider instructions)
- Does not copy components (use
stratum-uikit addfor that) - Only installs the Slate theme — for Obsidian or Quartz see Custom Themes
After running init
Section titled “After running init”1. Install peer dependencies:
npx expo install react-native-unistyles react-native-nitro-modules phosphor-react-native2. Add the @/ path alias to tsconfig.json:
{ "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./src/*"] } }}3. Wrap your app root:
// app/_layout.tsx (or App.tsx)import '@/providers/unistyles'; // must be imported before ThemeProviderimport { ThemeProvider } from '@/providers/ThemeProvider';
export default function RootLayout() { return ( <ThemeProvider initialTheme="slate" initialColorScheme="light"> {/* your navigator */} </ThemeProvider> );}4. Build with a dev client — Expo Go will not work:
npx expo run:iosnpx expo run:androidstratum.config.json
Section titled “stratum.config.json”init writes this file to your project root. stratum-uikit add reads it to know where to copy components.
{ "componentDir": "src/components", "tokenDir": "src/tokens", "providerDir": "src/providers", "hookDir": "src/hooks", "defaultTheme": "slate"}You can edit these paths if your project uses a different structure.
Related
Section titled “Related”- stratum-uikit add — add individual components after init
- stratum-uikit theme list — see available themes
- Installation — manual setup guide
- Quick Start — first component in 5 minutes