あいつの日誌β

働きながら旅しています。

React Storybook で Material-UI を試す

create-react-app material-ui-storybook && cd $_
getstorybook
npm install --save react-tap-event-plugin material-ui
npm install --save-dev  storybook-addon-material-ui

edit `src/stories/index.js

 import React from 'react';
-import { storiesOf, action, linkTo } from '@kadira/storybook';
+import { storiesOf, action, linkTo, addDecorator } from '@kadira/storybook';
 import Button from './Button';
 import Welcome from './Welcome';
+import {muiTheme} from 'storybook-addon-material-ui';
+import RaisedButton from 'material-ui/RaisedButton';
 
 storiesOf('Welcome', module)
   .add('to Storybook', () => (
@@ -15,3 +17,9 @@ storiesOf('Button', module)
   .add('with some emoji', () => (
     <Button onClick={action('clicked')}>😀 😎 👍 💯</Button>
   ));
+
+storiesOf('Material-UI', module)
+  .addDecorator(muiTheme())
+  .add('RaiseButton', () => (
+    <RaisedButton label="Default" />
+  ));

open http://localhost:9009