Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@prototypearea/storybook-amp

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prototypearea/storybook-amp

Storybook addon that allows you to display AMP HTML components generated with react in your stories

  • 0.0.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Storybook AMP · npm package

Storybook addon that allows you to display AMP HTML components generated with react in your stories

Installation

npm install -D @prototypearea/storybook-amp

Configuration

Then create a file called addons.js in your storybook config.

Add following content to it:

import '@prototypearea/storybook-amp/register';

Demo

https://storybook-amp.netlify.com

Usage

To SSR the code at runtime time use the withAmpDecorator decorator inside config.js or specific story. To set custom settings, use the amp parameter.

// config.js
import { configure, addDecorator, addParameters } from '@storybook/react';
import { withAmpDecorator } from '@prototypearea/storybook-amp';

const customStyles = ''; // some styles

// global
addDecorator(withAmpDecorator)
addParameters({
  amp: {
    isEnabled: true,
    styles: customStyles, // Custom styles from some string
  },
});

You can use the amp parameter to override settings on each story individually:

// per story
storiesOf('AMP', module)
  .add('Default', () => <Button>Send</Button>, {
    amp: {
      isEnabled: false,
    }
  });

Keywords

FAQs

Package last updated on 25 Aug 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc