layer-esm

A modern TypeScript adaptation of Layer for browser dialogs, alerts, confirms, messages, loading states, tips, prompts, tabs, and iframe layers.

Layer-style APIs, modern package formats

Use named TypeScript imports without jQuery, global variables, or external runtime styles and images.

Dialog helpers

Open alerts, confirmations, messages, loading indicators, prompts, tips, tabs, page content, and iframe layers.

Window controls

Close, minimize, restore, maximize, retitle, resize, and manage active layers through exported helpers.

Typed package

Consume ESM, CommonJS, and declaration outputs from the package root with runtime-injected component styles.

Install from npm

Add layer-esm to a browser application that uses a package manager and bundler.

View the layer-esm npm package
Terminal
npm install layer-esm

Usage

Import only the helpers you need. This example opens a confirmation, reports success, and closes a loading layer.

Explore every exported function and type
TypeScript
import { close, confirm, load, msg } from "layer-esm";

const loadingIndex = load();

confirm("Continue?", {}, () => {
  msg("Confirmed");
  close(loadingIndex);
});

Explore the library

The playground exercises public APIs in the browser, while TypeDoc lists the complete exported contract.