-
|
I'm using raw React Native (without Expo) along with react-native-unistyles, and running Storybook in on-device mode. The toolbar itself appears, and built-in addons like "Controls" and "Backgrounds" show up fine. I added it via globalTypes in preview.js, something like this: const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
decorators: [GlobalTheme],
globalTypes: {
theme: {
name: 'Theme',
description: 'Global theme for components',
defaultValue: 'light',
toolbar: {
icon: 'circlehollow',
items: [
{ value: 'light', title: 'Light Theme' },
{ value: 'dark', title: 'Dark Theme' },
],
},
},
},
initialGlobals: {
theme: 'light',
},
}``` |
Beta Was this translation helpful? Give feedback.
Answered by
dannyhw
Sep 12, 2025
Replies: 1 comment 3 replies
-
|
Unfortunately react native storybook (ondevice) doesn't support toolbars yet, you can add addons though with your own panel where you can do anything. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Theres not yet good documentation on how to add addons but you can check this as an example
https://github.com/storybookjs/react-native/blob/next/packages/ondevice-notes/src/register.tsx
You basically need a
/registerfile that loads your addonIts not necessary to publish the addon you can also just have a folder locally that you load as an addon as long as it has the register file in there