1

I want to create stories using both Typescript and MDX, therefore I have in my main.js:

module.exports = {
  stories: ['../src/**/*.stories.(mdx|ts)'],
  addons: ['@storybook/addon-docs', 'storybook-addon-preview']
};

However I don't want to have "Docs" tab next to "Canvas". How do I remove it? Without '@storybook/addon-docs' MDX story is not displayed.

Tschareck
  • 4,071
  • 9
  • 47
  • 74

2 Answers2

5

Put this in preview.js:

export const parameters = {
  previewTabs: {
    'storybook/docs/panel': {
      hidden: true
    }
  }
};

Used in Storybook version 6.0.x

Tschareck
  • 4,071
  • 9
  • 47
  • 74
1

I am currently using @storybook/angular@6.0.21 and the previous answer unfortunately did not work for me. I was able to find a solution in the storybook DocsPage documentation.

The relevant section:

You can replace DocsPage at any level by overriding the docs.page parameter:

- With null to remove docs
- With MDX docs
- With a custom React component

I was able to completely remove the DocsPage for a single story like this:

export const myStory = () => ({
  moduleMetadata: MODULE_METADATA,
  component: MyComponent,
});
myStory.parameters = {
  docs: { page: null },
};
Benjamin
  • 1,206
  • 1
  • 12
  • 23