Storybook Knobs Addon for react-native
This addon is depcrecated in favour of controls, please only use it for transitioning to CSF, Args and Controls
See examples for migrating from Knobs to Controls in the web Controls Addon README.
Storybook Knobs Addon allows you to edit react props using the Storybook UI using variables inside stories in Storybook.
Framework Support
This is a wrapper for the 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 @react-native-community/datetimepicker @react-native-community/slider
Configuration
Add following content to .storybook/main.js
:
module.exports = {
addons: ['@storybook/addon-ondevice-knobs'],
};
Make sure to use the withKnobs decorator when using knobs import { withKnobs } from '@storybook/addon-ondevice-knobs';
v6.5.0-rc.0
Adds template file for npx sb@next init --type react_native
Full Changelog: https://github.com/storybookjs/react-native/compare/v6.0.1-beta.12...v6.5.0-rc.0