kibana/packages/kbn-storybook
Tiago Costa e5d8d49164
chore(NA): assures a single version for the same dependency across the entire project (#78825)
* chore(NA): script to check for multiple version of same dependency

* chore(NA): remove multiple versions for the same dependency

* chore(NA): hook single_version_dependencies script into the CI

* chore(NA): remove grunt from the CI hook integration

* chore(NA): update kbn pm dist

* chore(NA): fix typechecking

* chore(NA): update code to run under last extract-zip version

* fix(NA): multiple versions of the same type dependency

* move validation to bootstrap (#13)

Co-authored-by: spalger <spalger@users.noreply.github.com>

* chore(NA): todo to remove logic to validate single version deps once we move into a single package.json

* chore(NA): remove verify dependency versions jenkins task

* chore(NA): update kbn pm dist file

* chore(NA): remove last mention to verify_dependency_versions.sh fom tasks.groovy

Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-10-02 00:46:00 +01:00
..
lib Storybook 6 and config changes (#75357) 2020-09-29 19:34:05 -05:00
index.ts Storybook 6 and config changes (#75357) 2020-09-29 19:34:05 -05:00
package.json chore(NA): assures a single version for the same dependency across the entire project (#78825) 2020-10-02 00:46:00 +01:00
preset.js Storybook 6 and config changes (#75357) 2020-09-29 19:34:05 -05:00
README.md Storybook 6 and config changes (#75357) 2020-09-29 19:34:05 -05:00
tsconfig.json Storybook 6 and config changes (#75357) 2020-09-29 19:34:05 -05:00
typings.d.ts Storybook 6 and config changes (#75357) 2020-09-29 19:34:05 -05:00
webpack.config.ts chore(NA): assures a single version for the same dependency across the entire project (#78825) 2020-10-02 00:46:00 +01:00
yarn.lock Add lockfile symlinks (#55440) 2020-01-27 11:38:20 -05: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.