c0395c9ef6
* [build_ts_refs] improve caches, allow building a subset of projects * cleanup project def script and update refs in type check script * rename browser_bazel config to avoid kebab-case * remove execInProjects() helper * list references for tsconfig.types.json for api-extractor workload * disable composite features of tsconfig.types.json for api-extractor * set declaration: true to avoid weird debug error * fix jest tests Co-authored-by: spalger <spalger@users.noreply.github.com> |
||
---|---|---|
.. | ||
preset | ||
src | ||
templates | ||
.babelrc | ||
BUILD.bazel | ||
package.json | ||
preset.js | ||
README.md | ||
tsconfig.json |
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 atsrc/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 withyarn 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.