Docs
Storybook Docs

docs

Parent: main.js|ts configuration

Type:

{
  autodocs?: boolean | 'tag';
  defaultName?: string;
  docsMode?: boolean;
}

Configures Storybook's auto-generated documentation.

autodocs

Type: boolean | 'tag'

Default: 'tag'

Enables or disables automatic documentation for stories.

  • true: Enables it for all stories
  • false: Disables it for all stories
  • 'tag': Enables it for stories tagged with 'autodocs'
.storybook/main.js
export default {
  // Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
  framework: '@storybook/your-framework',
  stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
  docs: {
    autodocs: 'tag',
  },
};

defaultName

Type: string

Default: 'Docs'

Name used for generated documentation pages.

.storybook/main.js
export default {
  // Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
  framework: '@storybook/your-framework',
  stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
  docs: {
    defaultName: 'Documentation',
  },
};

docsMode

Type: boolean

Only show documentation pages in the sidebar (usually set with the --docs CLI flag).

.storybook/main.js
export default {
  // Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
  framework: '@storybook/your-framework',
  stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
  docs: {
    docsMode: true,
  },
};