getStorybookUI() method is called on a View instance returned by the start() function. It returns a React component that renders your Storybook UI.
Usage
Parameters
Configuration options for the Storybook UI
Enable or disable the on-device UI. When
false, only the story component is rendered without navigation.Set as
false to disable the wrapper around the story view.Enable websockets to allow the Storybook server to remotely control the app.
The host for the websocket server.Defaults to:
- Android:
10.0.2.2 - iOS/other:
localhost
globalThis.STORYBOOK_WEBSOCKET.hostThe port for the websocket server.Can also be set via
globalThis.STORYBOOK_WEBSOCKET.portUse
wss:// instead of ws:// for websocket connections.Additional query string to append to the websocket URL.
The initial story to display when Storybook loads.Can be either:
- A story ID string:
"component--story" - An object with
kindandname:{ kind: "Component", name: "Story" }
Whether to persist the selected story between app restarts using the provided storage.
Storage implementation for persisting story selection.Typically use
@react-native-async-storage/async-storage:Custom theme overrides to customize the appearance of Storybook.See Theme Customization for details.
A custom UI component to replace the default Storybook UI.The component receives these props:
story: Current story contextstoryHash: All stories organized by hierarchysetStory: Function to change storiesstorage: Storage instancetheme: Applied themestoryBackgroundColor: Current background color (if backgrounds addon enabled)children: The StoryView component
Return Value
A React component that renders the configured Storybook UI.This component should be exported as your app’s root component:
Examples
Minimal Configuration
With Websockets for Remote Control
Story-Only Mode (No UI)
With Initial Story
With Custom Theme
Deep Linking Support
The returned component automatically supports deep linking to specific stories using thesbstoryid query parameter: