Search code examples
javascriptstorybookstorybook-addon-specifications

How to show subheading in Storybook?


I need to show subheadings in the left sidebar as shown in the attached picture.

Storybook version is 5.3.13.

Is there any parameter i need to change in the config file?

Storybook left sidebar


Solution

  • Check this link

    For React in your ./storybook/preview.jsadd this code.

    import { addParameters } from '@storybook/react';
    
    addParameters({
      options: {
        /**
         * display the top-level grouping as a "root" in the sidebar
         * @type {Boolean}
         */
        showRoots: true,
      },
    });