[RFC] Embeddable Stories #24169
KrystilizeNevaDies
started this conversation in
RFC
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Status: in-review; championed by @shilman
Summary
This proposal is aimed to enable storybook users to recursively nest stories within each other for preview/debugging purposes.
This means that you should be able to select another story to embed into your selected story where applicable (e.g. react's
children
field), and you should then be able to also edit/view properties of this embedded story.Problem Statement
While Storybook has the capability to help development, testing and documentation of individual components, it lacks the ability to quickly do the same for nested components, often requiring templates or manually nesting components with a render function.
This RFC aims to solve the problem of having no (UI-only) way to nest and test components.
Non-goals
Drastically changing the UI is not a part of this proposal.
Changing existing apis is not a part of this proposal.
Implementation
I propose that we introduce a serialisation change so that we can directly nest properties within another story preview.
I also propose that we implement the selection of other stories by dragging stories from the Explorer Tree into an applicable nesting field.
Doing this:
Should result in this:
Determining which fields should be able to nest stories would be the responsibility of the framework.
Prior Art
No response
Deliverables
Risks
Unresolved Questions
Alternatives considered / Abandoned Ideas
No response
Beta Was this translation helpful? Give feedback.
All reactions