-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Add different viewMode for iframed stories on Docs Tab #13444
Comments
@shilman should I try to implement this, or does this need to be discussed? |
Probably needs discussion. How would you implement it? |
@shilman I'm not sure it has to be viewMode. I think it would be great if each story (and its decorators) knows where it is. This could be composed like: viewContext: 'canvas' | 'docs' | 'iframe';
storyMode: 'inline' | 'iframe'; |
We're in the process of redoing this for 7.0, which is coming up: #14911 To be frank, it's probably worth waiting until all of that is ready and re-evaluating at that point. |
@manuelmeister As 7.0 is released, would you mind revisiting this issue? :) |
Is your feature request related to a problem? Please describe
Inside the Canvas / Preview Tab, I globally want to wrap my stories and display a header (title and additional information). But I don't want to wrap them on the Docs Tab.
I tried to create a decorator and check if
StoryContext.viewMode == 'docs'
but as described in #12566, the viewMode is alwaysstory
for iframed stories.Describe the solution you'd like
Aa different
viewMode
for the iFrame should be used. EitherdocsStory
inside the Docs Tab orcanvas
instead ofstory
on the Canvas / Preview Tab.Describe alternatives you've considered
Currently in my project, we wrap the component(s) inside the
template
, which means:storiesOf
to CSF or MDX now, because we would have to touch everything again when the angular integration is more matured.Are you able to assist to bring the feature to reality?
Yes, I just don't understand the/all implications or strategic decisions.
Additional context
I use storybook together with angular. This means that currently there is no way to inline the story inside the docs.
The text was updated successfully, but these errors were encountered: