storybook-addon-react-context
v1.1.2
Published
storybook addon for react context
Downloads
9
Maintainers
Readme
React Context Addon
Installation
yarn add storybook-addon-react-context --dev
Add to .storybook/addons.js
import 'storybook-addon-react-context/dist/register';
addDecorator to .storybook/config.js
import { addDecorator } from '@storybook/react';
import { withContextProvider } from 'storybook-addon-react-context';
import { ReactContextProvider } from './path/to/file';
addDecorator(withContextProvider({
provider: ReactContextProvider,
options: [
{
value: '1',
label: 'one'
},
{
value: '2',
label: 'two'
}
]
}));
This is used for displaying in the Storybook UI.
Contributing
yarn
yarn build
yarn example
Thanks
Thanks to Carlos for making storybook-addon-styled-component-theme and upon which this library was based on top of.