kibana/packages/kbn-storybook
Kibana Machine 98d7a37c73
[7.x] [Uptime] Run Sample uptime tests using @elastic/synthetics (#112128) (#113531)
* [Uptime] Run Sample uptime tests using @elastic/synthetics (#112128)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

* update test according to 7.x

* revert

Co-authored-by: Shahzad <shahzad.muhammad@elastic.co>
Co-authored-by: shahzad31 <shahzad31comp@gmail.com>
2021-10-04 16:28:53 +00:00
..
preset chore(NA): moving @kbn/storybook into bazel (#102731) (#102806) 2021-06-21 17:25:18 -04:00
src [7.x] [Uptime] Run Sample uptime tests using @elastic/synthetics (#112128) (#113531) 2021-10-04 16:28:53 +00:00
templates [storybook] Fix Shared UI Dep paths (#112631) (#112651) 2021-09-21 09:34:40 -04:00
BUILD.bazel [kbn/ui-shared-deps] split into two packages (#110558) (#112475) 2021-09-16 18:02:17 -04:00
package.json chore(NA): moving @kbn/storybook to babel transpiler (#107547) (#108095) 2021-08-10 17:52:03 -04:00
preset.js chore(NA): moving @kbn/storybook to babel transpiler (#107547) (#108095) 2021-08-10 17:52:03 -04:00
README.md [7.x] Storybook 6 and config changes (#75357) (#78894) 2020-10-05 12:43:44 -05:00
tsconfig.json [build_ts_refs] improve caches, allow building a subset of projects (#107981) (#108139) 2021-08-11 05:08:54 -04: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.