New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@epigraph/modal

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@epigraph/modal

The Epigraph Modal web component

latest
npmnpm
Version
1.0.8
Version published
Weekly downloads
6
50%
Maintainers
3
Weekly downloads
 
Created
Source

Epigraph Modal

This project includes a sample component using LitElement with TypeScript.

Import

You need to import our web component module. We recommend that you do this in the head. It's important that type="module" is specified.

Example

<head>
  <script type="module" async src="https://www.unpkg.com/@epigraph/modal/dist/epigraph-modal.min.js"></script>
</head>

Usage

You can insert epigraph-modal elements anywhere you'd like. Epigraph modal currently serves one purpose: to embed a responsive, customizable modal directly in your page.

Attributes

  • modal-background-style: [String, optional] Allows you to add additional styling onto the default modal background styling. This is a reactive attribute, so changing the attribute will force a modal reload.
  • modal-style: [String, optional] Allows you to add additional styling onto the default modal styling. This is a reactive attribute, so changing the attribute will force a modal reload.
  • close-button-style: [String, optional] Allows you to add additional styling onto the default close button styling. This is a reactive attribute, so changing the attribute will force a modal reload.
  • done-button-style: [String, optional] Allows you to add additional styling onto the default done button styling. This is a reactive attribute, so changing the attribute will force a modal reload.

Example: Modal for all platforms

<epigraph-modal modal-background-style="background-color: rgba(0, 255, 0, 0.5);">
  <div class="modal-content" slot="modal-content">
    <div class="modal-text">
      <div class="modal-text-scan-line">
        Scan the QR code to view this item in your space.
      </div>
      <br />
      <div class="modal-text-instructions">
        Using your mobile device* camera, scan the QR code below and
        follow the on-screen directions to see how this item looks in
        your space. <br />
        <br />
        *Technical requirements: iOS Version 11 and later or Android 8
        and later.
      </div>
    </div>
    <div class="modal-qr-container">
      <img class="modal-qr-image"
        src="qr-source-image.png" />
    </div>
  </div>
</epigraph-modal>

Events/Event Listeners

Currently the modal is shown upon receiving a show-modal event.

Example: dispatching an event

window.onload = () => {
    document.querySelector('epigraph-modal').dispatchEvent(new Event('show-modal'));
}

Known Issues

Currently, the web component only nallows limited custom inline styling through the use of reactive properties, it is our hope that we will have more options in the future to allow more custom styling of the web component.

Keywords

web-components

FAQs

Package last updated on 27 Jul 2021

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