@storybook/react-native

  • Version 10.2.3
  • Published
  • 169 kB
  • 12 dependencies
  • MIT license

Install

npm i @storybook/react-native
yarn add @storybook/react-native
pnpm add @storybook/react-native

Overview

A better way to develop React Native Components for your app

Index

Variables

variable RN_STORYBOOK_EVENTS

const RN_STORYBOOK_EVENTS: { RN_GET_INDEX: string; RN_GET_INDEX_RESPONSE: string };

    variable RN_STORYBOOK_STORAGE_KEY

    const RN_STORYBOOK_STORAGE_KEY: string;

      variable STORYBOOK_STORY_ID_PARAM

      const STORYBOOK_STORY_ID_PARAM: string;

        Functions

        function getProjectAnnotations

        getProjectAnnotations: (
        view: View,
        annotations: any[]
        ) => () => Promise<
        storybook_internal_types.NormalizedProjectAnnotations<ReactRenderer>
        >;

          function prepareStories

          prepareStories: ({
          storyEntries,
          options,
          storySort,
          }: {
          storyEntries: (NormalizedStoriesSpecifier & { req: any })[];
          options?: ReactNativeOptions;
          storySort?: Addon_StorySortParameterV7;
          }) => {
          index: {
          v: number;
          entries: Record<string, storybook_internal_types.IndexEntry>;
          };
          importMap: Record<string, any>;
          };

            function start

            start: ({
            annotations,
            storyEntries,
            options,
            }: {
            storyEntries: (NormalizedStoriesSpecifier & { req: any })[];
            annotations: any[];
            options?: ReactNativeOptions;
            }) => View;

              function updateView

              updateView: (
              viewInstance: View,
              annotations: any[],
              normalizedStories: (NormalizedStoriesSpecifier & { req: any })[],
              options?: ReactNativeOptions
              ) => void;

                Classes

                class View

                class View {}

                  constructor

                  constructor(preview: PreviewWithSelection<ReactRenderer>, channel: Channel);

                    property createPreparedStoryMapping

                    createPreparedStoryMapping: () => Promise<void>;

                      property getStorybookUI

                      getStorybookUI: (
                      params?: Partial<Params>
                      ) => () => react_jsx_runtime.JSX.Element;

                        Interfaces

                        interface Storage

                        interface Storage {}

                          property getItem

                          getItem: (key: string) => Promise<string | null>;

                            property setItem

                            setItem: (key: string, value: string) => Promise<void>;

                              interface StorybookConfig

                              interface StorybookConfig {}

                                property addons

                                addons: Array<
                                | string
                                | {
                                name: string;
                                options?: Record<string, any>;
                                }
                                >;

                                  property framework

                                  framework?: '@storybook/react-native';

                                    property reactNative

                                    reactNative?: ReactNativeOptions;

                                      property stories

                                      stories: StorybookConfig$1['stories'];

                                        Type Aliases

                                        type InitialSelection

                                        type InitialSelection =
                                        | `${StoryKind}--${StoryName}`
                                        | {
                                        /**
                                        * Kind is the default export name or the storiesOf("name") name
                                        */
                                        kind: StoryKind;
                                        /**
                                        * Name is the named export or the .add("name") name
                                        */
                                        name: StoryName;
                                        };

                                          type Params

                                          type Params = {
                                          onDeviceUI?: boolean;
                                          /**
                                          * Set as false to disable the wrapper around the story view.
                                          * NOTE We may remove this in the future for a better solution.
                                          * default: true
                                          */
                                          hasStoryWrapper?: boolean;
                                          /**
                                          * Enable websockets for the storybook server to remotely control the storybook
                                          * default: false
                                          */
                                          enableWebsockets?: boolean;
                                          query?: string;
                                          /** The host for the websocket server. default: localhost */
                                          host?: string;
                                          /** The port for the websocket server. default: 7007 */
                                          port?: number;
                                          secured?: boolean;
                                          /** The initial story */
                                          initialSelection?: InitialSelection;
                                          /** Whether to persist story selection. default: true */
                                          shouldPersistSelection?: boolean;
                                          theme: ThemePartial;
                                          /** Used for persisting story selection. required. */
                                          storage?: Storage;
                                          /** The custom UI component to use instead of the default UI */
                                          CustomUIComponent?: SBUI;
                                          };

                                            type ThemePartial

                                            type ThemePartial = DeepPartial<Theme>;

                                              Package Files (1)

                                              Dependencies (12)

                                              Dev Dependencies (13)

                                              Peer Dependencies (7)

                                              Badge

                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@storybook/react-native.

                                              • Markdown
                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@storybook/react-native)
                                              • HTML
                                                <a href="https://www.jsdocs.io/package/@storybook/react-native"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>