Skip to content

Instantly share code, notes, and snippets.

@chulanovskyi
Created June 18, 2019 13:16
Show Gist options
  • Save chulanovskyi/dcb8908b336f1e57e52f2a34b13cfff0 to your computer and use it in GitHub Desktop.
Save chulanovskyi/dcb8908b336f1e57e52f2a34b13cfff0 to your computer and use it in GitHub Desktop.
storybook config
import { configure, addDecorator } from '@storybook/react';
import { addParameters } from '@storybook/react';
import { create } from '@storybook/theming';
import { withInfo } from '@storybook/addon-info';
import { withKnobs } from '@storybook/addon-knobs';
import '../src/style.sass';
addParameters({
options: {
theme: create({
base: 'light',
brandTitle: 'Brand',
brandUrl: 'https://www.brand-url.com/'
})
}
});
addDecorator(withInfo({ inline: true, source: false }));
addDecorator(withKnobs);
const req = require.context('../src', true, /\.stories\.tsx$/);
function loadStories() {
req.keys().forEach(req);
}
configure(loadStories, module);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment