* chore(NA): update gitignore to include first changes from moving into a single package.json * chore(NA): update gitignore * chore(NA): move all the dependencies into the single package.json and apply changes to bootstrap * chore(NA): fix types problems after the single package json * chore(NA): include code to find the dependencies used across the code * chore(NA): introduce pure lockfile for install dependencies on build * chore(NA): update clean task to not delete anything from xpack node_modules * chore(NA): update gitignore to remove development temporary rules * chore(NA): update notice file * chore(NA): update jest snapshots * chore(NA): fix whitelisted licenses to include a new specify form of an already included one * chore(NA): remove check lockfile symlinks from child projects * chore(NA): fix eslint and add missing declared deps on single pkg json * chore(NA): correctly update notice * chore(NA): fix failing jest test for storyshots.test.tsx * chore(NA): fix cypress multi reporter path * chore(NA): fix Project tests check * chore(NA): fix problem with logic to detect used dependes on oss build * chore(NA): include correct x-pack plugins dep discovery * chore(NA): discover entries under dynamic requires on vis_type_timelion * chore(NA): remove canvas * test(NA): fix jest unit tests * chore(NA): remove double react declaration from storyshot test file * chore(NA): try removing isOSS check * chore(NA): support for plugin development * chore(NA): update logic to fix unit tests and typechecking * chore(NA): support to run npm scripts in child kbn projects across all envs * chore(NA): support github checks reporter on x-pack and remove cpy types as the package correctly provides them * chore(NA): update cpy version * chore(NA): include last kbn pm changes * chore(NA): update style on build_production_projects.ts * chore(NA): remove any cast fom telemetry opt in stats * chore(NA): remove del and re-use rm -rf again Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
lib | ||
index.ts | ||
package.json | ||
preset.js | ||
README.md | ||
tsconfig.json | ||
typings.d.ts | ||
webpack.config.ts |
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.