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.

PropertyDescriptionRequired
options.storiesarray of story configsYes

stories is an array of Storybooks that you want to pull stories from

PropertyDescriptionRequired
storyUrlPrefixprefix url of the storybook deploymentYes
descriptiondescription of the storybook storiesYes
storiesUrlurl of the storybook's stories.jsonNo
filterRegExp filter to match onNo
filterTagsArray of Storybook tags to match onNo
metaadditional data to add to matching pagesNo
Mosaic BETA

Coming soon