Issue by mnmtanish
_Monday Sep 26, 2016 at 09:21 GMT_
_Originally opened as https://github.com/storybooks/storybook-addon-options/issues/4_
It can be useful to show some panels by default when viewing certain stories.
Related issue: https://github.com/kadirahq/storybook-addon-knobs/issues/29#issuecomment-247503389
cc: @UsulPro
Good point, will add this to the list for #1209 api-v2
@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
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.
@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.
Perfect, thanks for the heads up!
Good tip @UsulPro !
I think that's certainly one to add to the docs somewhere!
upd: this option was renamed from selectedAddonPanel to selectedPanel.
For example:
setOptions({ selectedPanel: 'storybook/actions/panel' });
Most helpful comment
Good tip @UsulPro !
I think that's certainly one to add to the docs somewhere!