A Storybook addon useful when you have many projects built on top of a unique Design System.
A component can behave in different ways and storybook stories describe them. When your Design System is used by a lot of different projects we can lose sight of the whole picture.
Storybook ErDiagram manages links between component stories and projects that use them.
npm install --save-dev storybook-er-diagram
# yarn add -D storybook-er-diagram
module.exports = {
addons: ["storybook-er-diagram"],
};
add erDiagramList
object to the story default export parameters and use the template name as key.
The name must be equal to the story template.
export default {
title: "Example/Button",
component: Button,
parameters: {
erDiagramList: {
Primary: ["Project-A", "Project-B", "Project-C", "Project-D"],
["Second Story"]: ["Project-B", "Project-C"],
["Another story"]: ["Project-A", "Project-D"],
},
},
const Template = (args) => <Button {...args} />;
export const Primary = Template.bind({});
export const secondStory = Template.bind({});
export const thirdStory = Template.bind({});
thirdStory.storyName = "Another story"
};