Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-native

> 前端框架
Open source

📓 Storybook for React Native!

127.0K stars0 likes7 views
WebsiteGitHub

About

📓 Storybook for React Native!

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

For React Native CLI you can use this template Existing project

Run init to setup your project with all the dependencies and configuration files:

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.

No changes to App.tsx are needed. Set STORYBOOK_ENABLED=true and run:

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. 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:

You should configure the path to your story files in the main.ts config file from the .rnstorybook folder. Decorators and Parameters

For stories you can add decorators and parameters on the default export or on a specific story.

For global decorators and parameters, you can add them to preview.tsx inside your .rnstorybook folder. 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:

[!NOTE] deviceAddons ensures on-device addons are only loaded at runtime on the device, avoiding errors during server-side operations. For backwards compatibility, listing them in addons still works. Using the addons in your story

For details of each ondevice addon you can see the readme:

  • actions
  • backgrounds
  • controls
  • notes 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. Expo Router

Create a dedicated route for Storybook:

Then navigate to /storybook in your app to view stories. In-app integrat

Issues· 24 open

View all issuesOpen on GitHub
  • #925

    On-device Controls stop working after Fast Refresh: "cannot render when canvasElement is unset"

    Updated Sep 24, 2026
  • #924

    [Feature Request] Close Bottom Sheet When Story is Selected

    Updated Sep 15, 2026
  • #923

    Importing from `@storybook/react-native` pollutes the React Native TypeScript environment with Node.js types

    Updated Sep 15, 2026
  • #505

    Automated "All stories" story

    Updated Aug 19, 2026
  • #866

    Story tags

    Updated Mar 11, 2026
  • #511

    Create global control shared by all stories

    Updated Feb 16, 2026
  • #617

    react-native autodocs support

    Updated Feb 5, 2026
  • #541

    Add 'check' option in @storybook/addon-ondevice-controls

    feature requestUpdated Jan 6, 2026
  • #780

    asyncstorage on web: error reading from async storage ReferenceError: window is not defined

    Updated Aug 9, 2025
  • #734

    Support story play function

    feature requestUpdated Jun 14, 2025

> Tags

TypeScriptexporeactreact-nativestorybook

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedDec 1, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架