kibana/packages/kbn-shared-ux-storybook
Spencer a3b2757e4e
[type-summarizer] reimplement for broader support (#135163)
* [type-summarizer] reimplement for broader support

* Enable sourceMaps in all packages

* include naming collision in summarizePackage test

* fix readmes

* remove unnecessary transient dependency

* remove code that was commented out

* remove outdated todo comment

* ensure errors triggered by untyped-exports are ligible

* remove unused import

* break out snippet generation from AstIndexer

* refactor several massive files into smaller pieces and add more inline docs

* fix typos

* update jest snapshots

* add sections to readme that points people to the useful parts of the source code along with a high-level overview of how the type-summarizer works

* remove --dump flag, it doesn't work

* use decName instead of calling names.get a second time

* include `export` as invalid name
2022-07-06 13:48:45 -05:00
..
src [Shared UX] Move No Data Cards to packages (#134503) 2022-06-21 09:10:00 -07:00
BUILD.bazel [type-summarizer] reimplement for broader support (#135163) 2022-07-06 13:48:45 -05:00
package.json [sharedUX] Move to Package-based Architecture (#127546) 2022-03-16 17:13:58 -04:00
README.mdx [sharedUX] Move to Package-based Architecture (#127546) 2022-03-16 17:13:58 -04:00
tsconfig.json [type-summarizer] reimplement for broader support (#135163) 2022-07-06 13:48:45 -05:00

---
id: kibSharedUXStorybook
slug: /kibana-dev-docs/shared-ux/packages/kbn-shared-ux-storybook
title: Shared UX Storybook
summary: The `@kbn/shared-ux-storybook` package provides Storybook assets for Shared UX and other teams.
date: 2022-03-11
tags: ['kibana', 'dev', 'sharedUX']
---

## About Shared UX Storybook

This package provides the Storybook implementation of `@kbn/shared-ux-services` as well as the configuration for the Shared UX Storybook site.

- `/src/services` The `@kbn/shared-ux-services` implementation.
- `src/config` The Storybook site configuration.

## Storybook site

Run `yarn storybook shared_ux` from `/kibana` to view the site.  It pulls in `*.stories.tsx` from all Shared UX packages and plugins and combines them into a single configuration.

## Decorator

If you're writing stories for your own components that compose Shared UX components, you can use a pre-configured [Storybook Decorator](https://storybook.js.org/docs/react/writing-stories/decorators) in your Storybook configuration:

```ts
// preview.ts

import { addDecorator } from '@storybook/react';
import { servicesDecorator } from '@kbn/shared-ux-storybook';

addDecorator(servicesDecorator);
```

This will not only expose parameters, but also wrap your story in a pre-wired `SharedUxServicesProvider`.