This addon for Storybook adds a tab that displays the compiled HTML for each story.
With NPM:
npm i --save-dev @kickstartds/storybook-addon-html
With Yarn:
yarn add -D @kickstartds/storybook-addon-html
// .storybook/main.js
module.exports = {
// ...
addons: [
"@kickstartds/storybook-addon-html",
// ...
],
};
You can add decorators to wrap the story. This is usefull if you only want a subset of your decorators being applied for the html output.
export const parameters = {
html: {
decorators: [
(storyFn, context) => (
<MyProvider>
{storyFn(context)}
</MyProvider>
)
],
},
};
- React