New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Addon-Docs doesn't render Canvas/Docs tabs in v7 #21720
Comments
This is an intentional UI change in 7.0, which is a breaking release. If this change is negatively affecting you, can you describe the problem here? |
Thank you for the reply! As I mentioned, our team is used to using the Canvas/Docs tabs provided by addon-docs. I didn't see anything in the release notes about this behavior change, and in fact, the docs for the RC that I linked to still show these tabs in the screenshots. What's the reason for the change, and what's the new expected usage pattern? I though this was the whole purpose of addon-docs... |
I found this mention in the Storybook 7 blog post, but as I mentioned, the addon-docs README is still giving outdated information. I suppose the best fix here is to update the documentation. For those who also want the closest behavior to Storybook 6 + addon-docs (which required zero-config to show the Docs tab), you'll need to add the following to your
|
The Canvas/Docs tabs are also extremely useful to our teams - we often use Storybook for fully featured pages and now viewing the pages and page variations inside of the Autodocs page is not as helpful. Examples:
Each of these pages are used by different teams and having direct access to the page and it's specific docs is important. In Storybook 6 it would automatically generate these, now it appears we have to create MDX files for each page now if we want separate docs? |
I think adding an option in the storybook configuration would be good to switch to the previous behavior. |
@dylanjmcdonald is the scenario you're missing an auto-generated docs page for each story? were you using the default DocsPage documentation, or did you customize the template? |
I also need this Cacas/Docs tab toggle for the following reason: some components will have multiple examples, each with a docs file. |
Hello, I wanted to add my (my team's) voice to the chorus of people who have found this feature extremely useful. Having an additional line of documents on the side nav makes it more cluttered and hence hard to discover content. It was much more convenient to have a doc tab for each component designed on storybook rather than the current layout. |
For anyone who is looking, here is the post describing the docs changes in 7.0: https://storybook.js.org/blog/storybook-7-docs/ And there is an entire section in the MIGRATION docs describing the changes at a technical level: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#70-docs-changes |
That was a really nice feature having the docs tab always available. |
The Docs tab was very nice. Dear Storybook team, please consider the ability to enable it and disable this new "Docs" page, IMHO the tab is way handier. Thank you 🙌 |
Just chiming in here with similar sentiment! |
+++ the docs tab was nice |
The fact that clicking on a story in the navigation takes you to the canvas mode for that story instead of linking to the specific section within the docs page is a deal breaker for us. 😢 |
This isn't a bug, it's just a new architecture that'd been implemented. As stated in the docs, here's a solution: "And if you want autodocs applied to all stories, set it in ./storybook/main.js. More options here."
|
While the edit: I managed to move stories to the top by customizing export const parameters = {
options: {
storySort: (a, b) => (a.type == 'story' ? 0 : 1) - (b.type == 'story' ? 0 : 1),
},
} |
+1 on providing configuration options to show a docs/canvas tab like before. |
@mightym can you please provide an option to run docs as in version 6 in a tab instead in the sidebar? it breaks the UI which have another 2 tabs (we have tab for canvas, API (custom notes tab), we need the docs to be in one as well according to the design guidelines... Why do breaking changes over UI and UX if there aren't wanted at all? what's the benefit of removing working solution? |
Please give us Canvas and Docs back 🥇 |
I'm also missing the Docs tab after having migrated vom storybook v6 to v7. It was much cleaner in my eyes to have the focus on the stories. What bothers me most regarding the new UI is that clicking a story now automatically opens the Docs instead of the 1st story. As a result I need an additional click for every story! Using the custom sort approach from @bladeSk helps a lot as it makes sure the Docs aren't the first child anymore. Nevertheless I'd prefer having a Docs tab as it was in v6. |
Found this thread. Nice to know I'm not missing something that needs fixed in our setup to get the docs / canvas tab. I don't totally mind the individual canvas BUT I would like to get the code snippet and doc notes available for that specific story accessible from that view (otherwise user has to click back to the I just added https://storybook.js.org/addons/@storybook/addon-storysource to get the code snippet. Even if there was an add on tab that showed the documentation comments that would be great. |
@adamdiestelkamp prioritizing other things but will fix that in 8.x or die trying! Source handling is in general is my pet peeve with Storybook today |
The docs/canvas is much better than side navbar list as UI/UX ! |
Describe the bug
Our team is used to using the Canvas/Docs tabs provided by addon-docs.
Storybook 6 repro
Storybook 7 repro
To Reproduce
I created a repro using
npx storybook@next repro
and choosing "React 18 Webpack5 (TS)" and provide that unmodified here: https://github.com/swrobel/storybook-7-docs-reproSystem
Additional context
No response
The text was updated successfully, but these errors were encountered: