Skip to content

Get started

This tutorial gets you to the first successful setup in an Expo + Metro app.

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.

Terminal window
bun add @opsydyn/crumbs-css@1.2.0
# or
npm install @opsydyn/crumbs-css@1.2.0

You also need react, react-native, and metro, which Expo already provides.

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.

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,
})
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>
)
}
Terminal window
npx expo start --clear

If Metro starts cleanly and the screen renders, the transform pipeline is working.

  • the package is installed like a normal dependency
  • Metro must be wrapped with withNativeStyles
  • .css.ts authoring compiles into native style output at transform time

Next: