Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kickstartds/storybook-addon-html


https://github.com/kickstartds/storybook-addon-html

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# Storybook Addon HTML

This addon for Storybook adds a tab that displays the compiled HTML for each
story.

## Getting Started

With NPM:

```sh
npm i --save-dev @kickstartds/storybook-addon-html
```

With Yarn:

```sh
yarn add -D @kickstartds/storybook-addon-html
```

### Register addon

```js
// .storybook/main.js

module.exports = {
// ...
addons: [
"@kickstartds/storybook-addon-html",
// ...
],
};
```

## Usage

You can add
[decorators](https://storybook.js.org/docs/react/writing-stories/decorators) to
wrap the story. This is usefull if you only want a subset of your decorators being applied for the html output.

```js
export const parameters = {
html: {
decorators: [
(storyFn, context) => (

{storyFn(context)}

)
],
},
};
```

## Supported frameworks

- React