Skip to content

Storybook: Show full source when it’s necessary #20046

@PeterDraex

Description

@PeterDraex

For some stories, it’s not sufficient to show source code from the story function. Instead, source code from the whole file needs to be shown. This can be done by setting parameter docs.source.code to __STORY__.

For example:

StoryName.parameters = {
  docs: {
    description: {
      story: 'A button supports `small`, `medium` and `large` size. Default size is `medium`.',
    },
    source: {
      // @ts-ignore
      code: __STORY__,
    },
  },
};

We need to go through all stories in documentation and set this parameter where necessary. It is necessary, for example, for Nested Submenu story on Menu docs page.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions