![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
storybook-amp
Advanced tools
Storybook addon for AMP Html. Allows to display in your stories AMP Html components generated with React.
Storybook addon for AMP (Accelerated Mobile Pages). Allows to display in your stories AMP Html components generated with React.
npm install -D storybook-amp
Next, update .storybook/main.js
to the following:
// .storybook/main.js
module.exports = {
stories: [
// ...
],
addons: [
// Other Storybook addons
'storybook-amp', // 👈 The addon registered here
],
};
To set custom settings, use the amp
parameter.
// .storybook/preview.js
const scripts = '';
const styles = '';
export const parameters = {
// Other defined parameters
amp: { // 👈 The addon parameters here
isEnabled: true, // Enable the addon, false by default (boolean)
scripts, // Global scripts to add, empty by default (string)
styles, // Custom css styles, empty by default (string)
},
};
You can use the amp
parameter to override settings on each story individually:
// Story example
export default {
title: "Components/amp-youtube",
parameters: {
amp: {
scripts: // 👈 Script needed by the story
`<script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js"></script>`,
},
},
};
export const Story = (args) => (
<amp-youtube
width="480"
height="270"
layout="responsive"
data-videoid='lBTCB7yLs8Y'
></amp-youtube>
)
Storybook AMP Html addon is an open-source project. We are committed to a fully transparent development process and appreciate highly any contributions. Whether you are helping us fix bugs, proposing new features, improving our documentation or spreading the word - we would love to have you as part of the community.
Please refer to our Contribution Guidelines and Code of Conduct.
The Storybook AMP Html addon is licensed under the MIT license — see the LICENSE file for details.
Initially created by onWidget and maintained by a community of contributors.
FAQs
Storybook addon for AMP Html. Allows to display in your stories AMP Html components generated with React.
The npm package storybook-amp receives a total of 86 weekly downloads. As such, storybook-amp popularity was classified as not popular.
We found that storybook-amp 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.