kibana/packages/kbn-storybook
Greg Thompson fa03028688
Enable CSS-in-JS styling with emotion (#98157)
* emotion deps

* kbn-babel

* kbn-test

* examples

* babel-plugin-styled-components config

* css prop type fixes

* type context

* declaration location

* some emotion types resolved

* clean up

* emotion v10 accomodations

* types

* kbn-crypto

* kbn-telemetry-tools

* bazel

* eslint rule; shared file regex array

* update paths

* Update packages/kbn-eslint-plugin-eslint/rules/module_migration.js

Co-authored-by: Spencer <email@spalger.com>

* remove placeholder styles

* doc api changes

* snapshot updates

* storybook comments

* use constant

* bump new deps

* condense versions

Co-authored-by: Spencer <email@spalger.com>
2021-07-09 13:42:50 -05:00
..
lib Enable CSS-in-JS styling with emotion (#98157) 2021-07-09 13:42:50 -05:00
preset chore(NA): moving @kbn/storybook into bazel (#102731) 2021-06-21 20:17:54 +01:00
templates chore(NA): moving @kbn/storybook into bazel (#102731) 2021-06-21 20:17:54 +01:00
BUILD.bazel chore(NA): moving @kbn/storybook into bazel (#102731) 2021-06-21 20:17:54 +01:00
ignore_not_found_export_plugin.ts [storybook] Ignore TS-related HMR warnings (#103605) 2021-06-29 22:34:50 -04:00
index.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
package.json chore(NA): moving @kbn/storybook into bazel (#102731) 2021-06-21 20:17:54 +01:00
preset.js chore(NA): moving @kbn/storybook into bazel (#102731) 2021-06-21 20:17:54 +01:00
README.md Storybook 6 and config changes (#75357) 2020-09-29 19:34:05 -05:00
tsconfig.json chore(NA): moving @kbn/storybook into bazel (#102731) 2021-06-21 20:17:54 +01:00
typings.ts chore(NA): moving @kbn/storybook into bazel (#102731) 2021-06-21 20:17:54 +01:00
webpack.config.ts [storybook] Ignore TS-related HMR warnings (#103605) 2021-06-29 22:34:50 -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.