React Storybook decorator to center components.
npm i @kadira/react-storybook-decorator-centered
Then add the decorator like this:
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import MyComponent from '../my_component';
import centered from '@kadira/react-storybook-decorator-centered';
storiesOf('MyComponent', module)
.addDecorator(centered);
.add('without props', () => (<MyComponent />))
.add('with some props', () => (<MyComponent text="The Comp"/>));
You can also add this decorator globally like this:
import { configure, addDecorator } from '@kadira/storybook';
import centered from '@kadira/react-storybook-decorator-centered';
addDecorator(centered);
configure(function () {
...
}, module);