@multiplatform.one/storybook
v7.4.1
Published
Cross-platform Storybook addon-actions for multiplatform.one
Readme
@multiplatform.one/storybook
Storybook glue for multiplatform.one: a cross-platform action() helper and
createPreview(), which wires themes, knobs, and i18n into Storybook globals
so every story runs inside the real app providers.
Install
pnpm add -D @multiplatform.one/storybookPeers include storybook, @storybook/addon-actions,
@storybook-community/storybook-dark-mode, @multiplatform.one/theme, and
tamagui.
What it owns
action(name)— platform-split: re-exports@storybook/addon-actionson web; on native (Expo/Metro) provides a console-logging mirror so shared.stories.tsxfiles work on devicecreatePreview(options)— builds a StorybookPreviewwith the framework decorator: theme + knob toolbar globals (preset, radius, space, elevation, …), dark-mode sync, and language switching- Channel events:
themeColorsChannelEvent,themeColorsOppositeChannelEvent
What it must not do
- No stories and no components — those live next to the code they cover
Usage
// .storybook/preview.tsx
import { createPreview } from "@multiplatform.one/storybook";
import { AppProvider } from "./appProvider"; // produced by createApp() from @multiplatform.one/core
import { themeConfig } from "./theme"; // produced by createDefaultThemeConfig() from @multiplatform.one/theme
import { i18n } from "./i18n";
export default createPreview({ themeConfig, i18n, AppProvider });// any .stories.tsx (works on web and native)
import { action } from "@multiplatform.one/storybook";
export const Basic = {
args: { onPress: action("pressed") },
};License
Apache-2.0
