@storybook/melody
Storybook for Melody/Twig: Develop Melody Components in isolation with Hot Reloading.
Last updated 9 months ago by pago .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @storybook/melody 
SYNC missed versions from official npm registry.

Storybook for Melody/Twig

Storybook for Melody/Twig is a UI development environment for your Melody/Twig components. With it, you can visualize different states of your UI components and develop them interactively.

Storybook Screenshot

Storybook runs outside of your app. So you can develop UI components in isolation without worrying about app specific dependencies and requirements.

Getting Started

Step 1: Add dependencies

cd my-melody-app
npm install @storybook/melody --save-dev

Step 2: Add a npm script

In your package.json, add the following npm script to start storybook:

{
  "scripts": {
    "storybook": "start-storybook"
  }
}

Step 3: Create the main file

Create the .storybook/main.js file to tell Storybook where to find your stories:

module.exports {
    stories: ['../src/**/*.stories.[tj]s'],
};

You can also add your custom Melody plugins through the melodyPlugins key like this:

module.exports {
    melodyPlugins: ['load-functions'],
    stories: ['../src/**/*.stories.[tj]s'],
};

Step 4: Write your stories

import Button from '../components/button.twig';

export default { title: 'Button', component: Button }

export const withText = () => ({
  props: { text 'some text' }
});

export const withEmoji = () => ({
  props: { text '???? ???? ???? ????' }
});

For more information visit: storybook.js.org


Storybook also comes with a lot of addons and a great API to customize as you wish. You can also build a static version of your storybook and deploy it anywhere you want.

Here are some featured storybooks that you can reference to see how Storybook works:

Docs

Current Tags

  • 0.0.3                                ...           latest (9 months ago)

3 Versions

  • 0.0.3                                ...           9 months ago
  • 0.0.2                                ...           9 months ago
  • 0.0.0                                ...           9 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |