hypnos 8c8b35a2d2 Merge remote-tracking branch 'origin/master' into release/3.3
# Conflicts:
#	CHANGELOG.md
#	addons/actions/package.json
#	addons/background/package.json
#	addons/centered/package.json
#	addons/comments/package.json
#	addons/events/package.json
#	addons/graphql/package.json
#	addons/info/package.json
#	addons/knobs/package.json
#	addons/links/package.json
#	addons/notes/package.json
#	addons/options/package.json
#	addons/storyshots/package.json
#	app/react-native/package.json
#	app/react/package.json
#	app/vue/package.json
#	lerna.json
#	lib/addons/package.json
#	lib/channel-postmessage/package.json
#	lib/channel-websocket/package.json
#	lib/channels/package.json
#	lib/cli/package.json
#	lib/codemod/package.json
#	lib/components/package.json
#	lib/ui/package.json
#	yarn.lock
2017-11-11 03:24:39 +03:00
..
2017-11-10 23:59:40 +03:00
2017-11-10 11:39:27 +09:00
2017-11-02 20:20:27 +01:00
2017-11-04 03:39:54 +03:00

addon-backgrounds

Build Status

React Storybook Screenshot

Getting Started

npm i --save @storybook/addon-backgrounds

Then create a file called addons.js in your storybook config.

Add following content to it:

import '@storybook/addon-backgrounds/register';

Then write your stories like this:

import React from 'react';
import { storiesOf } from "@storybook/react";
import backgrounds from "@storybook/addon-backgrounds";

storiesOf("Button", module)
  .addDecorator(backgrounds([
    { name: "twitter", value: "#00aced", default: true },
    { name: "facebook", value: "#3b5998" },
  ]))
  .add("with text", () => <button>Click me</button>);

Development

This project is built using typescript and is tested with jest. To get started, clone this repo and run the following command:

$ npm install # install node deps

To run the project locally, run:

$ npm run storybook # for storybook testing
# (coming soon) $ npm run test-watch # for testing

To test the project run:

$ npm test