Installation
Run CLI Init
Use the Storybook CLI to initialize Storybook in your project:When prompted, choose recommended and then native.
Install Dependencies
Storybook’s default UI depends on
react-native-reanimated and react-native-worklets. If they’re not already installed:Expo handles the babel plugin configuration automatically.
Configure Metro
Generate a metro config file if you don’t have one:Wrap your config with
withStorybook, using EXPO_PUBLIC_STORYBOOK_ENABLED to control inclusion:metro.config.js
Configure Layout
The layout configuration depends on your project’s navigation structure. Choose the pattern that matches your app:
- Stack-based Layout
- Tabs-based Layout
Move your existing app routes into a route group (e.g., Update the root layout:
app/(pages)/):app/_layout.tsx
The
unstable_settings ensures your app opens directly to Storybook when EXPO_PUBLIC_STORYBOOK_ENABLED is set.Video Tutorial
Watch this video tutorial for a visual walkthrough of the setup process:Next Steps
Writing Stories
Learn how to write your first story
Metro Configuration
Explore advanced Metro config options