# @opencodegraph/provider-storybook

> Add Storybook links and image previews to your code (OpenCodeGraph provider)

Latest version **0.0.3** (published 2023-12-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @opencodegraph/provider-storybook
pnpm add @opencodegraph/provider-storybook
yarn add @opencodegraph/provider-storybook
bun add @opencodegraph/provider-storybook
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2023-12-28 |
| First published | 2023-12-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 90.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 255 |
| Maintainers | sqs |

## Links

- npm: https://www.npmjs.com/package/@opencodegraph/provider-storybook
- Repository: https://github.com/sourcegraph/opencodegraph
- Homepage: https://github.com/sourcegraph/opencodegraph#readme
- Issues: https://github.com/sourcegraph/opencodegraph/issues
- npm.io page: https://npm.io/package/@opencodegraph/provider-storybook

## Dependencies (1)

- [@opencodegraph/provider](https://npm.io/package/@opencodegraph/provider.md) 0.0.3

## Recent versions

- 0.0.3 (latest) — 2023-12-28
- 0.0.2 — 2023-12-07
- 0.0.1 — 2023-12-07

## README

# Storybook context provider for OpenCodeGraph

This is a context provider for [OpenCodeGraph](https://opencodegraph.org) that annotates your React components and `*.story.ts?(x)` files with screenshots and links to your [Storybook](https://storybook.js.org/) component library. It works well with storybooks hosted on [Chromatic](https://chromatic.com/).

## Screenshot

![Screenshot of OpenCodeGraph annotations for Storybook in a code file](https://storage.googleapis.com/sourcegraph-assets/blog/screencast-vscode-storybook-v0.gif)

_Hover over a UI component in code to see what it looks like_

Visit the [OpenCodeGraph playground](https://opencodegraph.org/playground) for live examples.

## Usage

Add the following to your settings in any OpenCodeGraph client:

```json
"opencodegraph.providers": {
    // ...other providers...
    "https://opencodegraph.org/npm/@opencodegraph/provider-storybook": {
        "storybookUrl": "<URL to the Storybook for your application>"
    }
},
```

Tips:

- If you're using VS Code, you can put the snippet above in `.vscode/settings.json` in each repository if you have different storybooks per-repository.
- To use this with storybooks hosted on [Chromatic](https://chromatic.com/), see below in the "[Configuration](#configuration)" section.
- Play around with the Storybook provider in realtime on the [OpenCodeGraph playground](https://opencodegraph.org/playground).

## Configuration

<!-- Keep in sync with index.ts -->

```typescript
/** Settings for the Storybook OpenCodeGraph provider. */
interface Settings {
  /**
   * The URL to a published Storybook for your project.
   *
   * If you're using Chromatic, this is of the form `https://<branch>--<appid>.chromatic.com`; see
   * https://www.chromatic.com/docs/permalinks/#get-permalinks-to-your-project for how to obtain
   * this value.
   *
   * If the URL contains `<branch>`, it will always be replaced with `main`.
   *
   * TODO(sqs): Support non-main branches.
   */
  storybookUrl: string
}
```

## Development

- [Source code](https://sourcegraph.com/github.com/sourcegraph/opencodegraph/-/tree/provider/storybook)
- [Docs](https://opencodegraph.org/docs/providers/storybook)
- License: Apache 2.0

---
_Source: https://npm.io/package/@opencodegraph/provider-storybook · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
