question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docs: Show Code Open by default

See original GitHub issue

Hey team, I noticed the issue #8356 closed. I’d only like to have an option to customize the story view (especially source code view), too. Have you got any plan to resolve this issue?

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:35
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

18reactions
tklivescommented, Jun 3, 2021

Leaving this here to hopefully help someone in the future…

If you are just looking to have the code block open for a single story, you just need to add withSource="open" to your <Canvas> tag that wraps the story:

<Canvas withSource="open">
  <Story name="Cool story bro">
    <>
  </Story>
</Canvas>

Hope this helps someone like myself, since this isn’t documented anywhere that I could find.

Cheers!

5reactions
ldevebercommented, Oct 13, 2020

This would be lovely, I was just searching the docs on how to do this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Show Code Open by default · Issue #8356 - GitHub
I'd like to add live editor in our Storybook (as #6642 is not yet implemented) and if I can get more options for...
Read more >
Source - Storybook - JS.ORG
Storybook automatically generates a Source Doc Block within the Canvas to display the story's code snippet. It includes additional customization via parameters.
Read more >
Visual Studio Code Key Bindings
This page lists out the default bindings (keyboard shortcuts) and describes how you ... The Keyboard Shortcuts editor has a context menu command...
Read more >
In Storybook how can you display the full source of a ...
This will result in this when you want to display the code of the showcase: ... parameters={{ docs: {source: { code: HugeComponentShowcase, } ......
Read more >
Set or clear default apps - Pixel Phone Help - Google Support
For example, if you have multiple photo editing apps, you can choose which one to use to open a photo. Important: You're using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found