-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document module / storiesof / mdx story formats #7498
Conversation
This pull request is automatically deployed with Now. Latest deployment for this branch: https://monorepo-git-7440-module-format-docs.storybook.now.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM a few typos
- a classic [storiesOf format](../../formats/storiesof-story-format/), which adds stories through Storybook's API. | ||
- an experimental [MDX format](../../formats/mdx-story-format/), which mixes longform Markdown docs and JSX stories. | ||
|
||
Since Module format is a new additon to Storybook, most Storybook examples you'll find in the wild are written in the legacy [storiesOf format](../stories-of-format/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Module format is a new additon to Storybook, most Storybook examples you'll find in the wild are written in the legacy [storiesOf format](../stories-of-format/). | |
Since Module format is a new addition to Storybook, most Storybook examples you'll find in the wild are written in the legacy [storiesOf format](../stories-of-format/). |
``` | ||
|
||
This will add stories in the storybook like this: | ||
The `load` function may be called multiple times to load stories from different locations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will have to change this :)
title: 'Module Story Format' | ||
--- | ||
|
||
Module story format is the recommended way to [write stories](../../basics/writing-stories/) since Storybook 5.2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Module story format is the recommended way to [write stories](../../basics/writing-stories/) since Storybook 5.2. | |
The module story format is the recommended way to [write stories](../../basics/writing-stories/) since Storybook 5.2. |
|
||
Module story format is the recommended way to [write stories](../../basics/writing-stories/) since Storybook 5.2. | ||
|
||
It's called "module" format because the stories and component metadata are defined as ES6 modules. Every Module story file consists of a required default export and one or more named exports. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's called "module" format because the stories and component metadata are defined as ES6 modules. Every Module story file consists of a required default export and one or more named exports. | |
It's called "module" format because the stories and component metadata are defined as ES6 modules. Every module story file consists of a required default export and one or more named exports. |
|
||
It's called "module" format because the stories and component metadata are defined as ES6 modules. Every Module story file consists of a required default export and one or more named exports. | ||
|
||
Module format is supported in all frameworks except React Native, where you should use the [storiesOf format](../storiesof-story-format) instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Module format is supported in all frameworks except React Native, where you should use the [storiesOf format](../storiesof-story-format) instead. | |
The module format is supported in all frameworks except React Native, where you should use the [storiesOf format](../storiesof-story-format) instead. |
)); | ||
``` | ||
|
||
The string argument to `storiesOF` is the component title. IF you pass a string like `'Widgets|Button/Button'` it can also be used to position your component's story within [Storybook's story hierarchy](../../writing-stories/#story-hierarchy). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string argument to `storiesOF` is the component title. IF you pass a string like `'Widgets|Button/Button'` it can also be used to position your component's story within [Storybook's story hierarchy](../../writing-stories/#story-hierarchy). | |
The string argument to `storiesOf` is the component title. IF you pass a string like `'Widgets|Button/Button'` it can also be used to position your component's story within [Storybook's story hierarchy](../../writing-stories/#story-hierarchy). |
require('../stories/Bar.stories.js'); | ||
} | ||
|
||
configure(loadStories, module); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configure(loadStories, module); | |
load(loadStories, module); |
?
Issue: #7440
What I did