0.5.1 • Published 7 years ago

solar-popup v0.5.1

Weekly downloads
5
License
ISC
Repository
github
Last release
7 years ago

Solar-popup

Ultralight, ultra fast, ultra smooth Vanilla TypeScript popup. Framework independent but can be used with any framework.

12Kb minified

installation

You can install into your application by running npm i solar-popup

You can then use it like so:

import SolarPopup from "solar-popup"

function showSimplePopup() {
  var child = document.createElement("DIV")
  child.innerHTML = `<p>This is some content that can be supplied to the popup</p>
           <p>Also press the [ESC] key to close]</p>
           <button type="submit">Clicking a submit button will also close it</button>
        `
  var popup = new SolarPopup(child)
  popup.show()
}

showSimplePopup()

You can also import the default styles solar-popup.css which will style it for you.

Why

I made this popup because I had a requirement for a slide-in and slide-out popup with smooth CSS transitions, including a fade-in and fade-out modal background. I also wanted hooks for once the popup had left the screen and being able to inject arbitrary html inside it.

Features

  • It will close on ESC press key, clicking on the close x button anchor or submit events from children
  • Adds a modal background that fades in/our with CSS3 transitions
  • Popup itself slides in/out with CSS3 transitions

Demo

Live Demo

Video demo

Feel free to watch the video explanation of how it works here:

Testing

npm i
npm test
0.5.1

7 years ago

0.5.0

7 years ago

0.4.14

7 years ago

0.4.13

8 years ago

0.4.12

8 years ago

0.4.11

8 years ago

0.4.10

8 years ago

0.4.8

8 years ago

0.4.7

8 years ago

0.4.6

9 years ago

0.4.4

9 years ago

0.4.3

9 years ago

0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.3

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.10

9 years ago

0.2.9

9 years ago

0.2.8

9 years ago

0.2.7

9 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago