@bluebase/storybook-addon
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

BlueBase Storybook Addon

Getting started

Installation:

npm i --save-dev @bluebase/storybook-addon

Configuration

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:

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


storiesOf('Some Story', module)
	.add('story', () => (
		<BlueBaseConsumer>
			{(BB: BlueBase) => <BB.Components.SomeComponent title="A nice component" />}
		</BlueBaseConsumer>
	));

Readme

Keywords

none

Package Sidebar

Install

npm i @bluebase/storybook-addon

Weekly Downloads

26

Version

3.0.0

License

MIT

Unpacked Size

8.74 kB

Total Files

18

Last publish

Collaborators

  • bluebase-release-bot
  • abubakarsaddique
  • artalat