0.0.0 • Published 2 years ago

storybook-extras v0.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Getting started

  1. Install the addon:
yarn add @storybook-extras/preset -D
  1. Add the addon
// .storybook/main.ts
import { StorybookConfig } from '@storybook/angular';
import { ExtrasConfig } from '@storybook-extras/preset';

const config: StorybookConfig & ExtrasConfig = {
    ...
    "addons": [
        "@storybook-extras/preset",
        ...
    ],
    ...
}

export default config;
  1. To disable the built-in features, add the following to your main.js:
// .storybook/main.ts
import { StorybookConfig } from '@storybook/angular';
import { ExtrasConfig } from '@storybook-extras/preset';

const config: StorybookConfig & ExtrasConfig = {
    ...
    "addons": [
        "@storybook-extras/preset",
        ...
    ],
    ...
    "extras": {
        // disable Angular addon
        // by default it will only be added ONLY if the `framework` is set to `@storybook/angular`
        "angular": false,

        // disable console logs
        // further options are configurable in the `preview.js` file
        // please see the `Console` addon docs for more info
        "console": false,

        // disable markdown/html docs
        "markdown": false,
        // set options for markdown/html docs
        "markdown": {
            "includes": path.join(process.cwd(), 'src'),
            "excludes": [/\.component.html$/], // exclude angular component html files
        }

        // disable swagger docs completely
        "swagger": false,
        // set openapi url for swagger docs
        "swagger": {
            "stories": [
                {
                    "title": "Swagger UI",
                    "url": "https://petstore.swagger.io/v2/swagger.json"
                }
            ]
        },

    }
}

export default config;
  1. Refer to the sections below for the documentation of the respective addons.

Demo

Find the published demo storybook on Chromatic here

Addons

AddonDescriptionVersion
PresetStorybook Extrasaddon.preset.imgDocs
AngularExtra features for AngularDocs
Console LogsDisplay console logs in the storybookaddon.console.imgDocs
Markdown/HTML DocsDisplay markdown/html docs in the storybookaddon.markdown.imgDocs
OpenAPI/Swagger UIDisplay OpenAPI/Swagger UI in the storybookaddon.swagger.imgDocs
Toolbar ButtonsMakes adding a custom toolbar button a breatheaddon.toolbars.imgDocs
Story VariantsDisplay all variants of a story in one story page all togetheraddon.variants.imgDocs
0.0.0

2 years ago