Skip to main content
The StorybookConfig interface defines the configuration options for your Storybook React Native setup. This is typically exported from .storybook/main.ts or .storybook/main.js.

Interface Definition

interface StorybookConfig {
  stories: StorybookConfigBase['stories'];
  addons: Array<string | { name: string; options?: Record<string, any> }>;
  reactNative?: ReactNativeOptions;
  features?: Features;
  framework?: '@storybook/react-native';
}

Properties

stories
string[] | StoriesSpecifier[]
required
Array of glob patterns or story specifiers that define where your story files are located.
addons
Array<string | { name: string; options?: Record<string, any> }>
required
List of Storybook addons to enable. Can be addon package names or objects with name and options.
reactNative
ReactNativeOptions
React Native-specific configuration options.
features
Features
Feature flags to enable experimental or optional features.
framework
'@storybook/react-native'
Specifies the Storybook framework being used. Should be set to '@storybook/react-native'.

Complete Example

.storybook/main.ts
import type { StorybookConfig } from '@storybook/react-native';

const config: StorybookConfig = {
  stories: [
    '../components/**/*.stories.?(ts|tsx|js|jsx)',
  ],
  addons: [
    '@storybook/addon-ondevice-controls',
    '@storybook/addon-ondevice-actions',
    '@storybook/addon-ondevice-backgrounds',
    '@storybook/addon-ondevice-notes',
  ],
  framework: '@storybook/react-native',
  features: {
    ondeviceBackgrounds: true,
  },
  reactNative: {
    playFn: false,
  },
};

export default config;

ReactNativeOptions

interface ReactNativeOptions {
  /**
   * Note that this is for future and play functions are not yet fully supported on native.
   */
  playFn?: boolean;
}

Features

interface Features {
  /** Enable the built-in on-device backgrounds addon panel. */
  ondeviceBackgrounds?: boolean;
}

See Also

Build docs developers (and LLMs) love