Hide addon panel for all stories by default #26058
Unanswered
hhourani27
asked this question in
Help
Replies: 2 comments 2 replies
-
Any updates on this? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Automatically hiding the addons panel is broken in Storybooks 8 (please fix 🙏), but I do have this extremely hacky fix. Add it to import { addons } from "@storybook/manager-api"
// Hack fix to automatically close the addons panel.
addons.ready().then(() => {
setTimeout(() => {
const closeAddonsButton = document.querySelector(
// eslint-disable-next-line quotes
'button[title^="Hide addons"]',
)
if (closeAddonsButton instanceof HTMLElement) {
const isHidden = sessionStorage.getItem("addons-hidden") === "true"
if (!isHidden) {
closeAddonsButton.click()
sessionStorage.setItem("addons-hidden", "true")
}
}
// long delay for storybooks to initialize
}, 1000)
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I am trying to hide the addon panel by default for all stories.
I tried this solution and added
options: { showPanel: true }
topreview.ts
But when I added
options
, Storybook didn't start correctly and displayed a blank page at start.I also tried to follow this previous discussion and the Features and behavior documentation, but my version of storybook (7.6.8) doesn't have a
.storybook/manager.ts
fileSo I created
.storybook/manager.ts
withBut it didn't work, as I still see the addon panel when Storybook starts.
Is there something I missed? Thank you for your time!
Additional information
No response
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions