npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

layerpro

v3.0.1

Published

The real custom modals, alert, confirm, prompt... for your browser

Readme

LayerPro

layerpro

version downloads

Snyk Socket

Node.js Browser Deno tsup

React TypeScript Javascript

Vitest OXlint Playwright


What is LayerPro?

LayerPro replaces the boring browser alert(), confirm(), and prompt() with beautiful, customizable modals that work everywhere.

No more ugly popup boxes. No more blocking the main thread. Just clean, modern modals that your users will love.


Features

  • Zero runtime dependencies: no jQuery — pure vanilla DOM helpers; React/react-dom are external and only used to render the modal body
  • Multiple modal types: alert, confirm, prompt, message
  • Fully customizable: appearance, behavior, and content
  • Dockable windows (taskbar style): click a dock icon to restore, focus, or minimize — just like an OS taskbar
  • Draggable & Resizable: instant, with no transition lag while resizing
  • Maximize is pure CSS: uses position: fixed + insets, so it follows the viewport with no JS resize listeners
  • Fade in/out transitions for open/close
  • TypeScript support: full type definitions

Installation

npm install layerpro

Or use directly in HTML:

<script src="https://cdn.jsdelivr.net/npm/layerpro"></script>

Quick Start

Import LayerPro once in your app entry point:

import "layerpro";

That's it. Now you have alert(), confirm(), prompt(), and message() globally.


Usage

Basic Modals

alert("Hello World!");

confirm("Are you sure?", () => {
  console.debug("User clicked YES");
});

prompt("What's your name?", (name) => {
  console.debug("User entered:", name);
});

message("Operation complete!");

Custom Popups

layerpro.popup.open({
  id: 'myModal',
  name: 'My Modal',
  body: '<p>Your content here</p>',
  width: 450,
  height: 350,
  buttons: {
    confirm: { text: "OK", cb: () => {} },
    cancel: { text: "Cancel", cb: () => {} }
  }
});

React Components

In a React environment, you can pass React components directly:

layerpro.popup.open({
  id: 'reactModal',
  name: 'React Modal',
  body: <MyComponent />,   // React element
  width: 500,
  height: 400
});

The body Parameter

The body property accepts different content types:

| Type | Example | |------|---------| | Plain text | body: "Hello" | | HTML string | body: "<p>Hello</p>" | | React element | body: <Component /> |

Note: In React, always use elements (<Component />), not function calls (Component()).


Options

{
  id: string,           // Unique ID
  body: any,            // Content (text, HTML, or React)
  name: string,         // Modal title
  icon: string,         // Icon (HTML entity)

  // Dimensions
  width: number,
  height: number,
  minWidth: number,
  minHeight: number,
  maxWidth: number,
  maxHeight: number,

  // Position
  top: number | string,
  left: number | string,
  right: number | string,
  bottom: number | string,

  // Animation
  fadeIn: number,
  fadeOut: number,
  timer: number,

  // Features
  movable: boolean,
  resizable: boolean,
  maximize: boolean,
  iconize: boolean,
  dockable: boolean,
  close: boolean,
  raised: boolean,

  // Buttons
  buttons: {
    confirm?: { text: string; cb?: () => void },
    cancel?: { text: string; cb?: () => void }
  }
}

Methods

| Method | Description | |--------|-------------| | layerpro.popup.open(props) | Open a modal | | layerpro.popup.close(id) | Close a modal | | layerpro.popup.center(id) | Center modal | | layerpro.popup.maximize(id) | Maximize modal | | layerpro.popup.iconize(id) | Minimize to dock | | layerpro.popup.movable(id) | Enable drag | | layerpro.popup.resizable(id) | Enable resize |


Browser Support

Chrome 80+ • Firefox 75+ • Safari 13+ • Edge 80+


Contributing

LayerPro is open source and free for everyone. The current source is private, but anyone is welcome to join. If you'd like to contribute, propose changes, or just talk about the project, get in touch:

Participation is voluntary and free — everyone is free to take part.


License

MIT License

Credits

Copyrigth (c) Dario Passariello