Get started
This tutorial gets you to the first successful setup in an Expo + Metro app.
1. Install the package
Section titled “1. Install the package”Install the published compatibility release from npm:
Crumbs 1.2.0 supports SDK 56/57/58; SDK 58/RN 0.88 requires this release. See the verified release status. Match the app’s Node/SDK requirements.
bun add @opsydyn/crumbs-css@1.2.0# ornpm install @opsydyn/crumbs-css@1.2.0You also need react, react-native, and metro, which Expo already provides.
2. Wrap Metro
Section titled “2. Wrap Metro”In metro.config.js:
const { getDefaultConfig } = require("expo/metro-config")const { withNativeStyles } = require("@opsydyn/crumbs-css/metro-plugin")
const config = getDefaultConfig(__dirname)
module.exports = withNativeStyles(config)Babel is the default. SDK 58 apps can optionally enable Expo’s Rust transformer; keep this Metro wrapper in either mode.
3. Add a .css.ts module
Section titled “3. Add a .css.ts module”Create app/styles/screen.css.ts:
import { style } from "@opsydyn/crumbs-css/style"
export const screen = style({ alignItems: "center", flex: 1, justifyContent: "center", padding: 24,})
export const title = style({ color: "#c8aa6e", fontSize: 24, fontWeight: 700,})4. Use the compiled styles
Section titled “4. Use the compiled styles”import { Text, View } from "react-native"import * as s from "./styles/screen.css"
export function Screen() { return ( <View style={s.screen}> <Text style={s.title}>crumbs-css is wired up</Text> </View> )}5. Start Expo
Section titled “5. Start Expo”npx expo start --clearIf Metro starts cleanly and the screen renders, the transform pipeline is working.
What you learned
Section titled “What you learned”- the package is installed like a normal dependency
- Metro must be wrapped with
withNativeStyles .css.tsauthoring compiles into native style output at transform time
Next: