Skip to content

web-mask-layerBrowser-side mask layer

A simple, lightweight and customizable web mask layer with plain JavaScript API. Supports singleton pattern, custom styles, and smooth animations.

Why this library

web-mask-layer is a simple and direct mask layer for loading states in browser applications:

  • no runtime dependencies — pure vanilla DOM operations
  • singleton pattern for efficient memory usage
  • target any DOM element or the entire page body
  • custom styles and CSS classes for easy theming
  • smooth CSS animations for enter and leave transitions

Runtime notes

  • This is a pure browser-side library with no framework dependency.
  • It can be used in any browser-based project — Vue, React, Angular, or plain HTML.
  • In SSR applications, call createLoading() only on the client side.

Next steps

Released under the MIT License.