Is there a way to publish your stories and allow others to extend them? #11240
-
I'm wondering if this is possible. I have a set of core components I want to add stories for (in React). The current plan is to publish this library to npm, however we also want people to use our components and architecture to make their own components (either in their projects or in a separate component library they make). We also want to have scaffolding tools that install storybook as a dependency so they are encouraged to make stories themselves. However, we realized in this workflow, there would be two storybook instances. Is there any way for our users to import our stories from the published package and add their own stories to it, so they still see all the "core" stories on their custom storybook implementation? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@wagedomain I think you are looking for the latest feature of Storybook: composition Here's the documentation I've found for it. On the other hand, a Story is just a function you can export. So it can be re imported easily elsewhere ! |
Beta Was this translation helpful? Give feedback.
-
Is composition currently released? This seems exactly like what I want but I'm finding it hard to find docs about the feature / availability, etc. beyond the link you sent me. |
Beta Was this translation helpful? Give feedback.
@wagedomain I think you are looking for the latest feature of Storybook: composition
Here's the documentation I've found for it.
https://github.com/storybookjs/storybook/blob/979eafa7b4cd8530c7665bbc7684db43e2564c24/docs/src/pages/configurations/composition/index.md
On the other hand, a Story is just a function you can export. So it can be re imported easily elsewhere !