Storybook: Can storybook display the sample code for the component?

Created on 14 Sep 2017  路  13Comments  路  Source: storybookjs/storybook

Hi storybook team,

I am wondering whether storybook support show the sample code on the storybook site for the component that display on page?

Like I write a Button component, and I want to show developers how to use the component?

import Button from '/components/Button';

<Button>This is a button.</Button>
question / support

Most helpful comment

Can storybook display the sample html code for the component????

All 13 comments

One of the options is to use addon-info

https://github.com/storybooks/storybook/tree/master/addons/info

@igor-dv Thanks a lot, it works.

Can storybook display the sample html code for the component????

Want to know if storybook can display HTML code +1

Try the storysource addon

One of the options is to use addon-info

https://github.com/storybooks/storybook/tree/master/addons/info

addon-info is only compatible with react though, we use Angular here so can't use it 馃槩

We have this setup but there is a lot of noise being displayed (still better than nothing to be fair)

@blemaire Will be fixing this as part of Storybook Docs: https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a

I saw this medium post a little while and have been dying for this to come out.
I've got a couple of side projects going at the moment but when the time is right, I'd like to get onboard (if you need extra fingertips)

@blemaire Please join the #docs-mode channel on our Discord for docs-related chatter. Would love to have you involved!

@shilman already in there 馃槃 @Agaurooh#4198

it is not possible to show the component and template for angular right now, is it? am i missing something?

Was this page helpful?
0 / 5 - 0 ratings