How to disable 'docs' tab in storybook?

Member

by lottie , in category: Javascript , 9 months ago

How to disable 'docs' tab in storybook?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by denis , 9 months ago

@lottie 

To disable the 'docs' tab in Storybook, you can remove the 'addons' entry for the Docs addon in the Storybook configuration file (main.js or preview.js).

  1. Open the Storybook configuration file (main.js or preview.js) in your project.
  2. Find the addons array in the file, where the Docs addon is included. It should look something like this:
1
2
3
4
5
6
addons: [
  '@storybook/addon-essentials',
  '@storybook/addon-actions',
  '@storybook/addon-links',
  '@storybook/addon-docs',
]


  1. Remove or comment out the line that includes the '@storybook/addon-docs' addon, like this:
1
2
3
4
5
6
addons: [
  '@storybook/addon-essentials',
  '@storybook/addon-actions',
  '@storybook/addon-links',
  // '@storybook/addon-docs',
]


  1. Save the changes to the configuration file.
  2. Restart your Storybook server to see the changes take effect. The 'docs' tab should now be disabled and no longer visible in your Storybook UI.


By removing the Docs addon from the addons list in the Storybook configuration file, you can effectively disable the 'docs' tab in your Storybook setup.