-
SummaryIt used to be like this.
Now only one element is rendered. How to display multiple elements in one Canvas? Additional informationNo response Create a reproductionNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @dmitriybo This isn’t supported anymore. Can you elaborate what’s the necessity for rendering all stories in one canvas? You could just render multiple canvases. Wouldn't this be an alternative? |
Beta Was this translation helpful? Give feedback.
-
8.1 introduces a new Tags feature that provides a viable workaround for this. https://storybook.js.org/docs/writing-stories/tags You can write a story that renders whatever you want, ie. render your button 10 times with different variants in the same story. Then reference that with This isn't exactly what you're asking for, but for anyone out there that want a more flexible canvas that can render more stories/content, please open an RFC that details which problems you want solved and how the existing solutions are inadequate. |
Beta Was this translation helpful? Give feedback.
8.1 introduces a new Tags feature that provides a viable workaround for this.
https://storybook.js.org/docs/writing-stories/tags
You can write a story that renders whatever you want, ie. render your button 10 times with different variants in the same story. Then reference that with
<Canvas of={ButtonStories.AllButtonVariants} />
. Finally, give the story the tags["!dev", "!test"]
to exclude it from the sidebar and test-runner tests.This isn't exactly what you're asking for, but for anyone out there that want a more flexible canvas that can render more stories/content, please open an RFC that details which problems you want solved and how the existing solutions are inadequate.