
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@dgonzalezr/storybook-addon-html
Advanced tools
A Storybook addon that extracts and displays compiled syntax-highlighted HTML
This addon for Storybook adds a tab that displays the compiled HTML for each story. It uses highlight.js for syntax highlighting.

With NPM:
npm i --save-dev @dgonzalezr/storybook-addon-html
With Yarn:
yarn add -D @dgonzalezr/storybook-addon-html
// .storybook/main.js
module.exports = {
// ...
addons: [
'@dgonzalezr/storybook-addon-html',
// ...
],
};
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',
},
},
};
You can override the wrapper element selector used to grab the component HTML.
export const parameters = {
html: {
root: '#my-custom-wrapper', // default: #root
},
};
When using Web Components, the HTML will contain empty comments, i.e. <!---->, or <!--..lit$..--> if using lit-html. If you want to remove these, use the removeComments parameter:
export const parameters = {
html: {
removeComments: true, // default: false
},
};
you can also provide your own regular expression to remove specific HTML comments:
export const parameters = {
html: {
// Remove only lit HTML comments, eg: `<!--?lit$117057236$-->`
removeComments: /<!--(.lit.*?)-->/g,
},
};
You can override the showLineNumbers and wrapLines settings for the syntax
highlighter by using the highlighter parameter:
export const parameters = {
html: {
highlighter: {
showLineNumbers: true, // default: false
wrapLines: false, // default: true
},
},
};
As of version 4.0.0 all frameworks are supported per default 🎉
FAQs
A Storybook addon that extracts and displays compiled syntax-highlighted HTML
We found that @dgonzalezr/storybook-addon-html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.