Skip to content
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 option to switch to a specific panel #811

Closed
shilman opened this issue Apr 15, 2017 · 7 comments
Closed

Add option to switch to a specific panel #811

shilman opened this issue Apr 15, 2017 · 7 comments

Comments

@shilman
Copy link
Member

shilman commented Apr 15, 2017

Issue by mnmtanish
Monday Sep 26, 2016 at 09:21 GMT
Originally opened as storybook-eol/storybook-addon-options#4


It can be useful to show some panels by default when viewing certain stories.
Related issue: storybook-eol/storybook-addon-knobs#29 (comment)

cc: @usulpro

@ndelangen
Copy link
Member

ndelangen commented Jul 7, 2017

Good point, will add this to the list for #1209 api-v2

@usulpro
Copy link
Member

usulpro commented Jul 7, 2017

@ndelangen maybe it's worth to mention that we have this API in lib/UI and in order to make it public (accessible via setOptions) we just need to allow to pass it here: https://github.com/storybooks/storybook/blob/master/lib/ui/src/modules/api/actions/api.js#L82

@glambert
Copy link

Regarding this, is it currently possible to set a default panel for ALL stories? For example, I'm using the storybook-readme addon and I'd want to have it as the default opened panel.

@usulpro
Copy link
Member

usulpro commented Jul 19, 2017

@ls-guillaume-lambert The order of addons in the "addons panel" is the same as you import them in 'addons.js'. And the first panel will be opened as you run Storybook.

@glambert
Copy link

Perfect, thanks for the heads up!

@ndelangen
Copy link
Member

ndelangen commented Jul 21, 2017

Good tip @usulpro !

I think that's certainly one to add to the docs somewhere!

@hcz
Copy link
Member

hcz commented Aug 12, 2019

upd: this option was renamed from selectedAddonPanel to selectedPanel.
For example:

setOptions({ selectedPanel: 'storybook/actions/panel' });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants