
theming
Scaffold a unified, cross-platform color theme system into an Expo Router app. Sets up semantic system colors (resolved from native iOS labels and Android Material You dynamic colors), brand colors, automatic dark/light re-rendering, the React Navigation ThemeProvider, and a useColors() / useTheme() context hook. Use whenever a user wants to set up theming, dark mode, dynamic or Material You colors, a unified color system, or a useColors/useTheme hook in an Expo / React Native app, even if they do not name a specific approach.
- Installs
- 194
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/code-with-beto/skills --skill theming- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads theming automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Expo Unified Theming
Set up one color system that works on iOS and Android at once. Instead of
sprinkling Color.ios.* and Color.android.dynamic.* (or hardcoded hex) all
over the app, the user gets semantic tokens (background, text, link, ...)
that resolve to the right native color per platform, flip with dark/light
automatically, and are read through a single useColors() hook.
This is the pattern from the Platano template, packaged so it drops into any Expo Router app.
What gets installed
Three files (bundled in assets/, adapt them to the project):
config.ts— the single source of truth. Semantic system tokens set to"native"or a hex, plus brand colors. This is the only file the user edits day to day.colors.ts— resolves tokens to real colors per platform, exposesgetSystemColor,useSystemColors, the brand helpers, andgetNavigationTheme.ThemeContext.tsx—ColorsProvider+ theuseColors()/useTheme()/useBrand()hooks built on React'suse.
Plus a small edit to the root _layout.tsx to wire the providers.
The two ideas that make this work
Explain these to the user, because they are the whole point and the two things people get wrong:
-
Re-render on theme change. Native and Material You colors are platform color objects, not strings React can diff. The signal that the theme changed is
useColorScheme(). So the resolvers take the color scheme as an argument even when they do not read it: that makes dark/light an explicit dependency, and the value recomputes when the user toggles. TheColorsProviderreadsuseColorScheme()once near the root, so a toggle re-renders every consumer. -
Two ThemeProviders, different jobs.
ColorsProvider(this skill) feedsuseColors()to your components. The navigationThemeProviderthemes the navigation chrome (headers, tab bars, default background). Both live at the root. Wire navigation's withgetNavigationTheme(dark)so the chrome matches your tokens. Do not confuse them or drop one. On Expo SDK 56+ the navigation theme bits (ThemeProvider,DarkTheme,DefaultTheme,Theme) import fromexpo-router/react-navigation; on older SDKs they come from@react-navigation/nativeinstead (see Step 1).
Step 1: Confirm the project, SDK, and the native Color API
This skill targets Expo Router apps on Expo SDK 56 or newer. SDK 56 is
where the Color API (iOS system colors + Android Material You) and the
expo-router/react-navigation re-exports the templates use both ship. Check the
SDK and the Color API before relying on "native" tokens.
# Find the project's app dir and root layout (root-level or under src/)
ls app/_layout.tsx src/app/_layout.tsx 2>/dev/null
# Check the installed Expo SDK major version
node -e "console.log('expo', require('expo/package.json').version)" 2>/dev/null
# Confirm expo-router exports the Color API
node -e "console.log('Color export:', !!require('expo-router').Color)" 2>/dev/null
grep -rl "android.dynamic\|ios.systemBackground" node_modules/expo-router/build 2>/dev/null | head -1
Branch on what you find:
- SDK 56+ (target): use the templates as written. Navigation theme bits
import from
expo-router/react-navigation. - Older than SDK 56: two adjustments are needed.
- Import
ThemeProvider,DarkTheme,DefaultTheme, andtype Themefrom@react-navigation/nativeinstead ofexpo-router/react-navigation— in bothcolors.tsand_layout.tsx. (Older Expo Router did not re-export them, so you go to React Navigation directly.) - The
ColorAPI likely is not present. Either recommend upgrading to SDK 56, or use the hex fallback: keep the files but set thesystemtokens inconfig.tsto hex values instead of"native"(no Material You, but everything else works).getBrandColorsstill works;isAndroidDynamicresolves to false withoutColor.
- Import
Also detect the project's import alias from tsconfig.json (commonly @/* →
src/* or the project root). Match that alias when you write imports. If there
is no alias, use relative paths.
Step 2: Decide where the files live
Put the three files together in one folder so their relative imports
(./config, ./colors) just work. Mirror the project's layout:
- App under
src/app/→ createsrc/theme/. - App at the root
app/→ createtheme/at the root.
Check for an existing theme/colors module or a ThemeProvider first. If the app
already has theming, do not clobber it. Read what is there, explain the
overlap to the user, and either merge into their setup or place these files
under a clearly named folder and let them migrate. Never blindly overwrite.
Step 3: Create the files
Copy the three bundled templates into the chosen folder, adapting:
- import aliases / relative paths to match the project,
- the
systemtokens andbrandcolors inconfig.tsto the user's brand (ask for their brand primary/accent, or keep the sensible defaults and tell them where to change them).
Read each asset and write it into the project (do not just symlink — these are the user's files now):
assets/config.ts→<theme>/config.tsassets/colors.ts→<theme>/colors.tsassets/ThemeContext.tsx→<theme>/ThemeContext.tsx
Keep the comments. They explain the re-render trick and the brand/dynamic behavior, which is exactly what a learner needs in their own codebase.
Step 4: Wire the root layout
Edit the existing _layout.tsx surgically — keep every provider, screen,
and option already there. The target shape wraps the tree in ColorsProvider
and themes navigation from an inner component that reads the color scheme:
// SDK 56+: from "expo-router/react-navigation". Older SDKs: "@react-navigation/native".
import { ThemeProvider } from "expo-router/react-navigation";
import { Stack } from "expo-router";
import { StatusBar } from "expo-status-bar";
import { useColorScheme } from "react-native";
import { getBrandColors, getNavigationTheme } from "@/theme/colors";
import { ColorsProvider } from "@/theme/ThemeContext";
export default function RootLayout() {
return (
<ColorsProvider>
{/* keep any existing providers (QueryClient, RevenueCat, gestures...) here */}
<RootLayoutInner />
</ColorsProvider>
);
}
function RootLayoutInner() {
const dark = useColorScheme() === "dark";
const { primary } = getBrandColors(dark);
return (
<>
<ThemeProvider value={getNavigationTheme(dark, primary)}>
{/* keep the project's existing <Stack> / screens exactly as they were */}
<Stack />
</ThemeProvider>
<StatusBar style={dark ? "light" : "dark"} />
</>
);
}
Integration rules:
ColorsProvidermust sit above anything that callsuseColors(). Putting it at or near the top ofRootLayoutis safest.- If the file is already split into
RootLayout+ an inner component, add theThemeProvideranduseColorScheme()there instead of creating a new inner component. - If
expo-status-baris not installed and the project does not already manage the status bar, you can skip theStatusBarline.
Step 5: Verify
- Typecheck if available:
npx tsc --noEmit(expect no new errors from the three files; the most common issue is a wrong import alias). - Tell the user to run the app, then toggle the OS appearance (or the simulator dark/light) and confirm colors and the navigation chrome update live. On a physical Android device, changing the wallpaper should shift the Material You palette.
Step 6: Show how to use it
Give the user a short usage snippet (and offer to drop a themed example into one screen if they want to see it immediately):
import { View, Text } from "react-native";
import { useColors, useBrand } from "@/theme/ThemeContext";
export function Example() {
const { background, text, secondaryText, separator } = useColors();
const { primary } = useBrand();
return (
<View style={{ flex: 1, backgroundColor: background, padding: 16 }}>
<Text style={{ color: text, fontSize: 20, fontWeight: "600" }}>
Unified theming
</Text>
<Text style={{ color: secondaryText }}>
Same tokens on iOS and Android.
</Text>
<View style={{ height: 1, backgroundColor: separator, marginVertical: 12 }} />
<Text style={{ color: primary }}>Brand accent</Text>
</View>
);
}
Outside React (a toast, a one-off style), use the non-hook accessor:
import { getSystemColor } from "@/theme/colors";
const card = getSystemColor("secondaryBackground") as string;
Customizing
- Change a color everywhere: edit
config.ts. Set a token to a hex to pin it, or back to"native"to follow the OS. - Turn off Material You for brand on Android: set
brand.useAndroidDynamic: falseand the hex brand applies on all platforms. - Add a token: add it to
systeminconfig.ts, then add its iOS / Android / default entries ingetNativeDefaultand a line inresolveSystemColorsinsidecolors.ts. TypeScript will point out anything you miss.
Notes
- This installs colors and brand only. It deliberately does not add spacing or radius presets or persistence; keep it focused unless the user asks.
- The files become the user's code. Encourage them to read the comments and tweak rather than treat it as a black box. That is the teaching goal of the lesson this skill ships with.
FAQ
What does the theming skill do?
Scaffold a unified, cross-platform color theme system into an Expo Router app. Sets up semantic system colors (resolved from native iOS labels and Android Material You dynamic colors), brand colors, automatic dark/light re-rendering, the React Navigation ThemeProvider, and a useColors() / useTheme() context hook. Use whenever a user wants to set up theming, dark mode, dynamic or Material You colors, a unified color system, or a useColors/useTheme hook in an Expo / React Native app, even if they do not name a specific approach.
How do I install theming?
Run npx skills add https://github.com/code-with-beto/skills --skill theming in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/theming/ (personal) or .claude/skills/theming/ (project).
Which AI agents can use theming?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is theming safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains theming?
It is published by code-with-beto in code-with-beto/skills. It has 194 recorded installs.
More from code-with-beto/skills
Popular mobile skills
design-mobile-apps
designed-by-ai/skills
Design mobile app screens with Sleek, edit Sleek projects, and implement their designs in React Native or HTML.
ios-design
uizze.sh
Design and review iOS UI/UX for iPhone apps in SwiftUI, UIKit, or React Native. Use for mobile app design, screen redesigns, navigation flows, typography, forms, keyboard and safe-area layout, and accessibility checks. Apply Apple Human Interface Guidelines and consult real product references through the optional Uizze connection.
vercel-react-native-skills
vercel-labs/agent-skills
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
animate-expo
emilkowalski/skills
Build animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web animation use animate.
xcode-project-setup
firebase/agent-skills
Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).
firebase-remote-config-basics
firebase/agent-skills
Manages Firebase Remote Config templates, feature flags, loading strategies, and SDKs (Android, iOS). Use when downloading/deploying remoteconfig JSON templates, managing version history/feature flags, setting in-app defaults, fetchAndActivate(), real-time listeners, or SDK setup. Don't use for Firebase Hosting, Auth, Firestore, Data Connect, Crashlytics, or App Hosting.