superset/superset-frontend/packages/superset-ui-demo
Evan Rusackas a6e05f4558
build(packages): npm build/publish improvements. Making packages publishable again. (#30196)
2024-12-10 16:54:41 -07:00
..
.storybook fix(storybook): fix broken Storybook stories during development (#29587) 2024-07-15 09:34:38 -06:00
storybook refactor: Creates the VizType enum (#31193) 2024-11-29 10:05:02 -03:00
.babelrc.json feat(storybook): Co-habitating/Upgrading Storybooks to v7 (dependency madness ensues) (#26907) 2024-02-15 07:40:17 -07:00
CHANGELOG.md build(packages): npm build/publish improvements. Making packages publishable again. (#30196) 2024-12-10 16:54:41 -07:00
README.md docs: replace broken david badges with libraries.io (#27903) 2024-04-04 23:00:23 -06:00
package.json build(packages): npm build/publish improvements. Making packages publishable again. (#30196) 2024-12-10 16:54:41 -07:00
tsconfig.json feat(build): uplift Storybook to v8 (#29408) 2024-07-09 15:02:28 -06:00

README.md

@superset-ui/demo

Version

Storybook of @superset-ui packages. See it live at apache-superset.github.io/superset-ui

Development

Run storybook

To view the storybook locally, you should first run npm ci && npm run bootstrap in the @superset-ui monorepo root directory, which will install all dependencies for this package and sym-link any @superset-ui packages to your local system.

After that run npm run storybook which will open up a dev server at http://localhost:9001.

Adding new stories

Existing package

If stories already exist for the package you are adding, simply extend the examples already exported for that package in the storybook/stories/<package>/index.js file.

New package

If you are creating stories for a package that doesn't yet have any stories, follow these steps:

  1. Add any new package dependencies (including any @superset-ui/* packages) via npm install <package>.

  2. Create a new folder that mirrors the package name

    e.g., mkdir storybook/stories/superset-ui-color/

  3. Add an index.js file to that folder with a default export with the following shape:

you can use the | separator within the storyPath string to denote nested stories e.g., storyPath: '@superset-ui/package|Nested i|Nested ii'

 default export {
   examples: [
     {
       storyPath: <string>,
       storyName: <string>,
       renderStory: <func> () => node,
     },
     ...
   ]
 };