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

electron-window-glass

v1.0.0

Published

Public macOS Liquid Glass and private backdrop for Electron BrowserWindows

Downloads

228

Readme

electron-window-glass

CI npm version npm downloads

Native macOS window effects for Electron's BrowserWindow. Choose either public Liquid Glass or private Core Animation Backdrop.

electron-window-glass example showing the system glass controls

Requirements

  • macOS 14 or later for kind: 'backdrop'
  • macOS Tahoe 26 or later for kind: 'glass'
  • Electron 41 or later

Install

pnpm add electron-window-glass

[!TIP] Building a Vite app? vite-plugin-native-modules handles electron-window-glass automatically.

Interactive Example

Run the transparent Electron control panel without cloning the repository:

npx -y electron-window-glass@latest example

Use

Liquid Glass

Create a transparent window before attaching glass. A frameless window is a common choice, but it is not required by this package.

import { BrowserWindow } from 'electron'
import { createWindowGlass } from 'electron-window-glass'

const window = new BrowserWindow({
  backgroundColor: '#00000000',
  frame: false,
  roundedCorners: false,
  transparent: true,
})

const glass = createWindowGlass(window, {
  kind: 'glass',
  cornerRadius: 14,
  style: 'regular',
  tintColor: '#7FA8FF20',
})

glass.setStyle('clear')

The selected radius also clips Electron's native content host so renderer content cannot spill past the effect's outline. On macOS versions earlier than 26, requesting kind: 'glass' throws.

Backdrop

Use kind: 'backdrop' to opt into backdrop effect engine and its custom controls:

const backdrop = createWindowGlass(window, {
  kind: 'backdrop',
  blurRadius: 40,
  cornerCurve: 'continuous',
  cornerRadius: 14,
  gradientMaskEndX: 0.65,
  noise: { intensity: 0.05, opacity: 0.025 },
  saturation: 1.8,
})

createWindowGlass waits for a usable native handle when necessary and disposes itself when the window closes. The backdrop renderer also reapplies its WindowServer tags after Electron’s resized event. Call glass.dispose() when removing an effect before the window closes. Disposal is idempotent.

For low-level integrations, createWindowGlass(window.getNativeWindowHandle(), options) returns a WindowGlass instance. Prefer the BrowserWindow overload: it is the only API that manages readiness, resize tag reapplication, and automatic cleanup.

Renderers and Runtime Controls

The second argument is a discriminated union based on kind:

  • GlassOptions → kind: 'glass'
  • BackdropOptions → kind: 'backdrop'

This keeps renderer-specific options type-safe and prevents backdrop-only controls from being passed to the native system glass renderer.

glass

| Options | Runtime controls | | -------------- | ----------------- | | alpha | setAlpha | | cornerRadius | setCornerRadius | | style | setStyle | | tintColor | setTintColor |

backdrop

| Options | Runtime controls | | ------------------ | ----------------- | | alpha | setAlpha | | blurRadius | setBlurRadius | | cornerCurve | setCornerCurve | | cornerRadius | setCornerRadius | | gradientMaskEndX | setGradientMask | | noise | setNoise | | saturation | setSaturation |

Important Limitations

The backdrop renderer dynamically uses private Core Animation and WindowServer symbols, including CABackdropLayer, CAFilter, and CGS window tags. Apple can change or remove these without notice; an Electron or macOS update can alter the visual result, break the effect, or cause instability. It is not suitable for Mac App Store distribution.

License

MIT