@storybook/react-native

  • Version 6.5.6
  • Published
  • 131 kB
  • 18 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 addArgsEnhancer

const addArgsEnhancer: ClientApi<ReactNativeFramework>;

    variable addArgTypesEnhancer

    const addArgTypesEnhancer: ClientApi<ReactNativeFramework>;

      variable addDecorator

      const addDecorator: ClientApi<ReactNativeFramework>;

        variable addParameters

        const addParameters: ClientApi<ReactNativeFramework>;

          variable clearDecorators

          const clearDecorators: ClientApi<ReactNativeFramework>;

            variable getStorybook

            const getStorybook: ClientApi<ReactNativeFramework>;

              variable raw

              const raw: ClientApi<ReactNativeFramework>;

                variable setAddon

                const setAddon: ClientApi<ReactNativeFramework>;

                  Functions

                  function configure

                  configure: (loadable: _storybook_core_client.Loadable, m: NodeModule) => void;

                    function getStorybookUI

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

                      function storiesOf

                      storiesOf: (kind: string, _module: NodeModule) => StoryApi<ReactNode>;

                        Type Aliases

                        type ComponentMeta

                        type ComponentMeta<
                        T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>
                        > = Meta<ComponentProps<T>>;
                        • For the common case where a component's stories are simple components that receives args as props:

                          export default { ... } as ComponentMeta<typeof Button>;

                        type ComponentStory

                        type ComponentStory<
                        T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>
                        > = Story<ComponentProps<T>>;
                        • For the common case where a (CSFv2) story is a simple component that receives args as props:

                          const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />

                          NOTE: this is an alias for ComponentStoryFn. In Storybook v7, ComponentStory will alias ComponentStoryObj

                        type ComponentStoryFn

                        type ComponentStoryFn<
                        T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>
                        > = StoryFn<ComponentProps<T>>;
                        • For the common case where a (CSFv2) story is a simple component that receives args as props:

                          const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />

                        type ComponentStoryObj

                        type ComponentStoryObj<
                        T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>
                        > = StoryObj<ComponentProps<T>>;
                        • For the common case where a (CSFv3) story is a simple component that receives args as props:

                          const MyStory: ComponentStory<typeof Button> = {
                          args: { buttonArg1: 'val' },
                          }

                        type Meta

                        type Meta<TArgs = Args> = ComponentAnnotations<ReactNativeFramework, TArgs>;
                        • Metadata to configure the stories for a component.

                          See Also

                          • [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)

                        type ReactNativeFramework

                        type ReactNativeFramework = {
                        component: ComponentType<any>;
                        storyResult: StoryFnReactReturnType;
                        };

                          type Story

                          type Story<TArgs = Args> = StoryFn<TArgs>;
                          • Story function that represents a CSFv2 component example.

                            See Also

                            • [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)

                              NOTE that in Storybook 7.0, this type will be renamed to StoryFn and replaced by the current StoryObj type.

                          type StoryFn

                          type StoryFn<TArgs = Args> = AnnotatedStoryFn<ReactNativeFramework, TArgs>;
                          • Story function that represents a CSFv2 component example.

                            See Also

                            • [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)

                          type StoryFnReactReturnType

                          type StoryFnReactReturnType = ReactElement<unknown>;

                            type StoryObj

                            type StoryObj<TArgs = Args> = StoryAnnotations<ReactNativeFramework, TArgs>;
                            • Story function that represents a CSFv3 component example.

                              See Also

                              • [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)

                            Package Files (1)

                            Dependencies (18)

                            Dev Dependencies (8)

                            Peer Dependencies (4)

                            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>