mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-31 05:03:21 +08:00
Storybook Knobs Addon for react-native
Storybook Knobs Addon allows you to edit react props using the Storybook UI using variables inside stories in Storybook.
This addon is a wrapper for addon @storybook/addon-knobs. Refer to its documentation to understand how to use knobs
Installation
yarn add -D @storybook/addon-ondevice-knobs @storybook/addon-knobs
Configuration
Create a file called rn-addons.js
in your storybook config.
Add following content to it:
import '@storybook/addon-ondevice-knobs/register';
Then import rn-addons.js
next to your getStorybookUI
call.
import './rn-addons';
See @storybook/addon-knobs to learn how to write stories with knobs and the crna-kitchen-sink app for more examples.