Storybook: Show Code Open by default

Created on 9 Oct 2019  路  10Comments  路  Source: storybookjs/storybook

Hey team, CSF is great but it would be even better if it were possible to configure the 'stories'

Where you currently have the "Show code" could there be config to allow this to show code by default and for the button to say "Hide code"

I'd be happy to contribute if someone could point me in the right direction.

Screenshot 2019-10-09 at 11 56 31

P0 docs source feature request todo

All 10 comments

I'd like to help contribute too. We can work together if you want @PaulieScanlon :)
I would, however, wait for the author(s) to give us a green signal to work on it.

Thanks for volunteering! 馃殌

I'd propose the following configuration API:

addParameters({ docs: { previewSource: 'open' } })

This would get translated into <Preview withSource='open'> here: https://github.com/storybookjs/storybook/blob/next/addons/docs/src/blocks/DocsPage.tsx#L94

Before you start, you should wait for this fix to get merged/released: https://github.com/storybookjs/storybook/pull/8024

Hey @sinharaksh1t yeah great! that sounds like a fab idea! Thanks for your input @shilman i'll keep an eye on #8024

Fantastic. Sounds like we're in an agreement then. I'll also keep an 馃憖 out for #8024. Once that gets merged, we'll start work on this. Thanks @PaulieScanlon and @shilman.

So it looks like #8024 has been merged successfully?

Slightly related comment:

I'd like to add live editor in our Storybook (as https://github.com/storybookjs/storybook/issues/6642 is not yet implemented) and if I can get more options for stories customization (especially that Show/Hide code part) from CSF it'll be great.

I know that we can use MDX for bigger customization, but as for me DocsPage is good enough and I don't need to create MDX documentation for each component. I'd only like to have an option to customize the story view (especially source code view).

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Any status update on this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tycho01 picture tycho01  路  76Comments

aericson picture aericson  路  97Comments

EdenTurgeman picture EdenTurgeman  路  81Comments

ilias-t picture ilias-t  路  73Comments

maraisr picture maraisr  路  119Comments