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

@ne1410s/popup

Package Overview
Dependencies
Maintainers
0
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ne1410s/popup

A lightweight configurable popup.

  • 0.3.100
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@ne1410s/popup

A lightweight & configurable modal popup.

<ne14-pop>
  <p>Hello world</p>
</ne14-pop>
  • Use: <script src="PATH_TO_UMD_SCRIPT"></script>
  • Extend: npm i @ne1410s/popup

Attributes

<ne14-pop move resize>YO' STUFF<ne14-pop></ne14-pop></ne14-pop>
  • move: User can drag the popup around
  • resize: User can alter the size of the popup
  • shrink: (Requires resize: User can reduce size below that initially presented)
  • open: The popup is opened immediately
  • no-close: The close icon is not made available
  • style: If supplied inline, the following styles are propagated to the element. They are fairly self-explanatory
    • background-color
    • border-radius
    • box-shadow

Events

const pop = document.querySelector('ne14-pop');

pop.addEventListener('open', () => {
  console.log('Just opened!');
});
  • open: Fired when the popup is opened
  • close: Fired when the popup is closed
  • confirmaccept: Fired when the confirm callback allowed the popup to close
  • confirmreject: Fired when the confirm callback prevented the popup from closing
  • dismissaccept: Fired when the dismiss callback allowed the popup to close
  • dismissreject: Fired when the dismiss callback prevented the popup from closing

Methods

  • open(): Opens the popup
  • close(): Closes the popup
  • wrap(): Wraps existing html element(s) in a new popup
  • confirm(): Closes the popup, unless confirmCallback is provided and returns false
  • dismiss(): Closes the popup, unless dismissCallback is provided and returns false.

Properties

  • confirmCallback: () => boolean: Return false to prevent a call to confirm from closing the popup
  • dismissCallback: () => boolean: Return false to prevent a call to dismiss from closing the popup

CSS Variables

Some degree of custom styling can be provided, by way of css variables:

ne14-pop {
  --background: rgba(0, 0, 0, 0.5);
  --border-radius: 5px;
  --box-shadow: 5px 5px 20px black;
}
  • --background Background behind the popup. Defaults to: rgba(0, 0, 0, .85)
  • --border-radius Border radius for the popup.
  • --box-shadow Box shadow for the popup (when stationary).

Keywords

FAQs

Package last updated on 18 Nov 2024

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