Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bluebasejs/storybook-addon

A Storybook JS addon to test BlueBase components in Storybook
https://github.com/bluebasejs/storybook-addon

Last synced: about 2 months ago
JSON representation

A Storybook JS addon to test BlueBase components in Storybook

Awesome Lists containing this project

README

        


BlueBase Storybook Addon

## Getting started

### Installation:
```sh
npm i --save-dev @bluebase/storybook-addon
```

### Configuration

```javascript
import React from 'react';
import { configure, addDecorator } from '@storybook/react';
import { BlueBaseDecorator } from '@bluebase/storybook-addon';

const BRConfigs = require('../bluerain');
addDecorator(BlueBaseDecorator(BRConfigs));

const req = require.context('../src', true, /.stories.tsx$/);
function loadStories() {
req.keys().forEach((filename) => req(filename));
}
configure(loadStories, module);
```

### Usage

In your story, test a BlueBase component like this:

```typescript
import { BlueBase, BlueBaseConsumer } from '@blueeast/bluerain-os';
import React from 'react';
import storiesOf from '@bluebase/storybook-addon';

storiesOf('Some Story', module)
.add('story', () => (

{(BB: BlueBase) => }

));
```