Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ntnbrtnkv/storybook-addon-react-context
Manage react context value
https://github.com/ntnbrtnkv/storybook-addon-react-context
react reactcontextapi storybook storybook-addon
Last synced: 16 days ago
JSON representation
Manage react context value
- Host: GitHub
- URL: https://github.com/ntnbrtnkv/storybook-addon-react-context
- Owner: ntnbrtnkv
- License: mit
- Created: 2019-03-01T12:49:07.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T16:50:42.000Z (about 2 years ago)
- Last Synced: 2024-12-30T18:28:12.540Z (about 2 months ago)
- Topics: react, reactcontextapi, storybook, storybook-addon
- Language: TypeScript
- Homepage:
- Size: 1.32 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React Context Addon
[![npm version](https://badge.fury.io/js/storybook-addon-react-context.svg)](https://badge.fury.io/js/storybook-addon-react-context)
![npm](https://img.shields.io/npm/dt/storybook-addon-react-context.svg)
[![CircleCI](https://circleci.com/gh/ntnbrtnkv/storybook-addon-react-context.svg?style=shield)](https://circleci.com/gh/ntnbrtnkv/storybook-addon-react-context)
![David](https://img.shields.io/david/ntnbrtnkv/storybook-addon-react-context.svg)
![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/ntnbrtnkv/storybook-addon-react-context.svg)---
#### Installation
```bash
yarn add storybook-addon-react-context --dev
```#### Add to .storybook/addons.js
```javascript
import 'storybook-addon-react-context/dist/register';
```#### addDecorator to .storybook/config.js
```javascript
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](https://github.com/echoulen) for making [storybook-addon-styled-component-theme](https://github.com/echoulen/storybook-addon-styled-component-theme) and upon which this library was based on top of.