storybook
Develops and visually tests UI components in isolation outside of the full application.
Claude Code
> /plugin marketplace add storybookjs/react-native> /plugin install react-native-storybook@react-native-storybook
Codex
$ codex mcp add storybook --url http://localhost:7007/mcp
Cursor
{ "mcpServers": { "storybook": { "url": "http://localhost:7007/mcp" } } }
Add it to mcp.json.
Gemini CLI
$ gemini mcp add --transport http storybook http://localhost:7007/mcp
GitHub Copilot
$ copilot mcp add --transport http storybook http://localhost:7007/mcp
OpenCode
{ "mcp": { "storybook": { "type": "remote", "url": "http://localhost:7007/mcp" } } }
Add it to opencode.json.
Windsurf
{ "mcpServers": { "storybook": { "serverUrl": "http://localhost:7007/mcp" } } }
Add it to mcp_config.json.
Security report
Not enough data
Known flaws
Not published
Signed build
Not published
Maintained
Oct 30, 2026
Last push
Licence
MIT
Runs as
Remote
localhost
Deprecated
Not published
Signals from public registries, not an audit. Checked Nov 11, 2026.
react-native-storybook README
Storybook for React Native
A new docs site is being built for Storybook for React Native, you can find it at https://storybookjs.github.io/react-native/docs/intro/.
Important This readme is for v10, for v9 docs see the v9.1 docs.
With Storybook for React Native you can design and develop individual React Native components without running your app.
If you are migrating from 9 to 10 you can find the migration guide here
For more information about storybook visit: storybook.js.org
Note Make sure you align your storybook dependencies to the same major version or you will see broken behaviour.
Table of contents
- ๐ Getting Started
- ๐ Writing stories
- ๐ Addons
- ๐ฑ Hide/Show Storybook
- โ๏ธ withStorybook wrapper
- ๐ง getStorybookUI
- ๐ Feature Flags
- ๐งช Using stories in unit tests
- ๐ค Contributing
- โจ Examples- Storybook for React Native
- ๐ค Agent skills
Getting Started
New project
There is some project boilerplate with @storybook/react-native and @storybook/addon-react-native-web both already configured with a simple example.
For Expo you can use this template with the following command
# With NPM
npx create-expo-app --template expo-template-storybook AwesomeStorybook
For React Native CLI you can use this template
npx @react-native-community/cli init MyApp --template react-native-template-storybook
Existing project
Run init to setup your project with all the dependencies and configuration files:
npm create storybook@latest
Then wrap your bundler config with the withStorybook function. It auto-detects Metro vs Re.Pack and handles everything โ entry-point swapping, story generation, and optional WebSocket setup.
// metro.config.js
const { getDefaultConfig } = require('expo/metro-config');
const { withStorybook } = require('@storybook/react-native/withStorybook');
const config = getDefaultConfig(__dirname);
module.exports = withStorybook(config);
No changes to App.tsx are needed. Set STORYBOOK_ENABLED=true and run:
STORYBOOK_ENABLED=true expo start
The wrapper automatically swaps your app's entry point with Storybook's entry point. When the variable is not set, your app runs normally with zero Storybook code in the bundle.
If you want to add everything yourself check out the manual setup guide.
Reanimated setup
Make sure you have react-native-reanimated in your project and the plugin setup in your babel config.
// babel.config.js
plugins: ['react-native-reanimated/plugin'],
Re.Pack setup
For projects using Re.Pack (Rspack/Webpack) instead of Metro, see the full Re.Pack Setup guide. You can also reference the RepackStorybookStarter project.
Expo router specific setup
For Expo Router projects, you can either use entry-point swapping (recommended) or create a dedicated Storybook route.
See the full Expo Router Setup guide for details.
Writing stories
In Storybook we use a syntax called CSF that looks like this:
import type { Meta, StoryObj } from '@storybook/react-native';
import { MyButton } from './Button';
const meta = {
component: MyButton,
} satisfies Meta<typeof MyButton>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Basic: Story = {
args: {
text: 'Hello World',
color: 'purple',
},
};
You should configure the path to your story files in the main.ts config file from the .rnstorybook folder.
// .rnstorybook/main.ts
import type { StorybookConfig } from '@storybook/react-native';
const main: StorybookConfig = {
stories: ['../components/**/*.stories.?(ts|tsx|js|jsx)'],
deviceAddons: ['@storybook/addon-ondevice-controls', '@storybook/addon-ondevice-actions'],
};
export default main;
Decorators and Parameters
For stories you can add decorators and parameters on the default export or on a specific story.
import type { Meta } from '@storybook/react';
import { Button } from './Button';
const meta = {
title: 'Button',
component: Button,
decorators: [
(Story) => (
<View style={{ alignItems: 'center', justifyContent: 'center', flex: 1 }}>
<Story />
</View>
),
],
parameters: {
backgrounds: {
values: [
{ name: 'red', value: '#f00' },
{ name: 'green', value: '#0f0' },
{ name: 'blue', value: '#00f' },
],
},
},
} satisfies Meta<typeof Button>;
export default meta;
For global decorators and parameters, you can add them to preview.tsx inside your .rnstorybook folder.
// .rnstorybook/preview.tsx
import type { Preview } from '@storybook/react-native';
import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds';
const preview: Preview = {
decorators: [
withBackgrounds,
(Story) => (
<View style={{ flex: 1, color: 'blue' }}>
<Story />
</View>
),
],
parameters: {
backgrounds: {
default: 'plain',
values: [
{ name: 'plain', value: 'white' },
{ name: 'warm', value: 'hotpink' },
{ name: 'cool', value: 'deepskyblue' },
],
},
},
};
export default preview;
Addons
The cli will install some basic addons for you such as controls and actions. Ondevice addons are addons that can render with the device ui that you see on the phone.
Currently, the addons available are:
@storybook/addon-ondevice-controls: adjust your components props in realtime@storybook/addon-ondevice-actions: mock onPress calls with actions that will log information in the actions tab@storybook/addon-ondevice-notes: Add some Markdown to your stories to help document their usage@storybook/addon-ondevice-backgrounds: change the background of storybook to compare the look of your component against different backgrounds
Install each one you want to use and add them to the deviceAddons list in your main.ts:
// .rnstorybook/main.ts
import type { StorybookConfig } from '@storybook/react-native';
const main: StorybookConfig = {
// ... rest of config
deviceAddons: [
'@storybook/addon-ondevice-notes',
'@storybook/addon-ondevice-controls',
'@storybook/addon-ondevice-backgrounds',
'@storybook/addon-ondevice-actions',
],
};
export default main;
Note
deviceAddonsensures on-device addons are only loaded at runtime on the device, avoiding errors during server-side operations..rnstorybookdoes not readaddons.
Using the addons in your story
For details of each ondevice addon you can see the readme:
Hide/Show storybook
Starting with v10.4, entry-point swapping is the default setup. Your existing in-app integration setup continues to work and is fully supported, but entry-point swapping is the recommended approach for new projects.
Entry-point swapping (recommended, v10.4+)
When using the bundler-agnostic withStorybook wrapper, set STORYBOOK_ENABLED=true to run Storybook. The wrapper swaps your app's entry point with Storybook's entry point automatically. When the variable is not set, your app runs normally with zero Storybook code in the bundle.
{
"scripts": {
"storybook": "STORYBOOK_ENABLED=true expo start",
"storybook:ios": "STORYBOOK_ENABLED=true expo start --ios"
}
}
Expo Router
Create a dedicated route for Storybook:
// app/storybook.tsx
export { default } from '../.rnstorybook';
Then navigate to /storybook in your app to view stories.
In-app integration (fully supported)
You can also import Storybook directly in your App.tsx. This approach continues to work and is fully supported:
import StorybookUI from './.rnstorybook';
import { MyApp } from './MyApp';
const isStorybook = process.env.EXPO_PUBLIC_STORYBOOK_ENABLED === 'true';
export default function App() {
return isStorybook ? <StorybookUI /> : <MyApp />;
}
withStorybook wrapper
withStorybook is a bundler-agnostic wrapper that configures your project for Storybook. It auto-detects whether you're using Metro or Re.Pack and handles entry-point swapping, story generation, and WebSocket setup.
// metro.config.js
const { getDefaultConfig } = require('expo/metro-config');
const { withStorybook } = require('@storybook/react-native/withStorybook');
const defaultConfig = getDefaultConfig(__dirname);
module.exports = withStorybook(defaultConfig);
When STORYBOOK_ENABLED=true is set, the wrapper activates. When it's not set, the wrapper is a no-op and your app runs normally.
Options
Options can be passed as a second argument. Most settings can also be controlled via environment variables (see Environment Variables).
configPath
Type: string, default: path.resolve(process.cwd(), './.rnstorybook')
The location of your Storybook configuration directory, which includes main.ts and other project-related files.
useJs
Type: boolean, default: false
Generates the .rnstorybook/storybook.requires file in JavaScript instead of TypeScript.
docTools
Type: boolean, default: true
Whether to include doc tools in the storybook.requires file. Doc tools provide additional documentation features and work with babel-plugin-react-docgen-typescript.
liteMode
Type: boolean, default: false
Whether to use lite mode for Storybook. In lite mode, the default Storybook UI is mocked out so you don't need to install all its dependencies like react-native-reanimated. This is useful for reducing bundle size and dependencies. Use this when using @storybook/react-native-ui-lite instead of @storybook/react-native-ui. Note: STORYBOOK_DISABLE_UI=true is equivalent to onDeviceUI: false, not liteMode: true.
experimental_mcp
Type: boolean, default: false
Enables an experimental MCP (Model Context Protocol) server for AI tooling to query Storybook documentation and component/story metadata.
The MCP server is available at the /mcp endpoint on the Storybook channel server. Configure your MCP client via its settings UI, or use:
npx mcp-add --type http --url "http://localhost:7007/mcp" --scope project
websockets
A new docs site is being built for Storybook for React Native, you can find it at With Storybook for React Native you can design and develop individual React Native components without running your app.
More MCP servers from other plugins.
sceneview
MCPShips with sceneview: The AI-first 3D & AR SDK for Jetpack Compose, SwiftUI and the web. Declarative 3D and AR for app developersโฆ
tessl
MCPShips with swift-ios-skills: 86 agent skills optimized for iOS 26+ development with Swift 6.3 and modern Apple frameworks.
axiom
MCPShips with axiom: Battle-tested skills, agents, and tools for modern Apple OS development โ Swift 6, SwiftUI, Liquid Glass, Appleโฆ
Questions about storybook.
- Which coding agents can use storybook?
- storybook works in any agent that reads an MCP config file: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf. Each agent reads it from its own file; this page names the file for each one.
- How do I add storybook to Claude Code?
- Run these in order, one at a time. 1. In Claude Code: /plugin marketplace add storybookjs/react-native 2. In Claude Code: /plugin install react-native-storybook@react-native-storybook

