The Storybook source is used to pull individual stories from Storybook, based on tags.
The Mosaic source will filter your Storybook's stories, based on title or tags.
For each matching story, a page is created in the Mosaic file-system.
- additional Mosaic tags can be added to each page using
additionalTags - additional Mosaic metadata can be added to each page using
additionalData
This information can be used to create a dynamic index of stories from Storybook.
yarn add @jpmorganchase/mosaic-source-storybook
The Storybook source is an HttpSource and shares the same base configuration.
The transformResponseToPagesModulePath prop has a default transformer which creates a page for each matching Story.
The stories option is an array of Storybook urls that are used as Sources.
Each story is matched on title using the filter Regexp (or by filterTags).
If specified, additionalTags and additionalData can be added to any matching pages.
| Property | Description | Required |
|---|---|---|
| options.stories | array of story configs | Yes |
stories is an array of Storybooks that you want to pull stories from
| Property | Description | Required |
|---|---|---|
| storyUrlPrefix | prefix url of the storybook deployment | Yes |
| description | description of the storybook stories | Yes |
| storiesUrl | url of the storybook's stories.json | No |
| filter | RegExp filter to match on | No |
| filterTags | Array of Storybook tags to match on | No |
| meta | additional data to add to matching pages | No |