kibana/packages/kbn-storybook
Spencer fa264aa7b6
remove all references to v7 theme (#113570) (#116824)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	src/plugins/presentation_util/public/components/solution_toolbar/items/quick_group.scss

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-01 02:27:29 +00:00
..
preset
src remove all references to v7 theme (#113570) (#116824) 2021-11-01 02:27:29 +00:00
templates [storybook] Fix Shared UI Dep paths (#112631) 2021-09-21 04:10:00 -07:00
BUILD.bazel [kbn/ui-shared-deps] split into two packages (#110558) 2021-09-16 12:06:46 -07:00
package.json chore(NA): moving @kbn/storybook to babel transpiler (#107547) 2021-08-10 20:26:46 +01:00
preset.js chore(NA): moving @kbn/storybook to babel transpiler (#107547) 2021-08-10 20:26:46 +01:00
README.md
tsconfig.json [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00

Kibana Storybook

This package provides ability to add Storybook to any Kibana plugin.

Setup Instructions

  • Add a .storybook/main.js configuration file to your plugin. For example, create a file at src/plugins/<plugin>/.storybook/main.js, with the following contents:

    module.exports = require('@kbn/storybook').defaultConfig;
    
  • Add your plugin alias to src/dev/storybook/aliases.ts config.

  • Create sample Storybook stories. For example, in your plugin create a file at src/plugins/<plugin>/public/components/hello_world/hello_world.stories.tsx with the following Component Story Format contents:

    import { MyComponent } from './my_component';
    
    export default {
      component: MyComponent,
      title: 'Path/In/Side/Navigation/ToComponent',
    };
    
    export function Example() {
      return <MyComponent />;
    }
    
  • Launch Storybook with yarn storybook <plugin>, or build a static site with yarn storybook --site <plugin>.

Customizing configuration

The defaultConfig object provided by the @kbn/storybook package should be all you need to get running, but you can override this in your .storybook/main.js. Using Storybook's configuration options.