storybook-code-view

1.0.0 • Public • Published

Storybook Addon: Component source

Storybook Addon Component source allows you to view your component template in storybook addon panel.

Framework Support : Vue, React(Coming soon...)

Storybook Addon Notes Demo

Getting Started

yarn add -D component-source

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

Add following content to it:

// register the notes addon as a tab
import 'component-source/register';

Now, you can use the source parameter to add a note to each story.

Vue

import { storiesOf } from '@storybook/vue';
 
import MyButton from '../src/components/MyButton.vue';
 
storiesOf('MyButton', module).add(
  'with some emoji',
  () => ({
    components: { MyButton },
    template: '<my-button>😀 😎 👍 💯</my-button>',
  }),
  { 
      source: {
        // Note: Path should be start from /src/ and must be end with file extension
           publicPath:'/src/components/MyButton.vue'
      },
  }
);

Package Sidebar

Install

npm i storybook-code-view

Weekly Downloads

30

Version

1.0.0

License

ISC

Unpacked Size

2.42 MB

Total Files

14

Last publish

Collaborators

  • ashtagged