I noticed a property in Storybooks Options Docs called selectedPanel
which I assume will allow me to pre-select an addon panel.
I'm unclear on how to use it. The example is:
options: { selectedPanel: 'storybook/a11y/panel' }
What I don't understand is where the 'storybook/a11y/panel' string comes from. What if I want to preselect the 'Source' panel?
I've encountered the same issue and managed to find out that the
panelId
can at least be found in the addon'sregister
source code step. For example, I wanted to openReadme
tab for certain stories.I ended up finding the id of the panel in
registerWithPanelTitle.js
, and then using it with thestoriesOf
API like this:For a11y, it can be found in
constants.ts
.Although, I've searched for those in the distributed
node_modules
versions in my case.P.S. If you want to reorder the panels for all of the stories globally, the list that the addons are imported in handles it.