Package Exports
- @whitespace/storybook-addon-html/html
- @whitespace/storybook-addon-html/react
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@whitespace/storybook-addon-html) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Storybook Addon HTML
This addon for Storybook adds a tab that displays the compiled HTML for each story. It uses highlight.js for syntax highlighting.
Getting Started
With NPM:
npm i --save-dev @whitespace/storybook-addon-html
With Yarn:
yarn add -D @whitespace/storybook-addon-html
Register addon
// .storybook/main.js
module.exports = {
// ...
addons: [
'@whitespace/storybook-addon-html',
// ...
],
};
Usage
The HTML is formatted with Prettier. You can override the Prettier config
(except parser
and plugins
) by providing an object following the
Prettier API override format in the
html
parameter:
// .storybook/preview.js
export const parameters = {
// ...
html: {
prettier: {
tabWidth: 4,
useTabs: false,
htmlWhitespaceSensitivity: 'strict',
},
},
};
Supported frameworks
As of version 4.0.0 all frameworks are supported per default 🎉