Storybook: Add option to switch to a specific panel

Created on 15 Apr 2017  路  7Comments  路  Source: storybookjs/storybook

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

addons stories

Most helpful comment

Good tip @UsulPro !

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

All 7 comments

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' });
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jonovono picture Jonovono  路  3Comments

dnlsandiego picture dnlsandiego  路  3Comments

sakulstra picture sakulstra  路  3Comments

tirli picture tirli  路  3Comments

purplecones picture purplecones  路  3Comments