electron-windows-titlebar

1.0.7 • Public • Published

electron-windows-titlebar


NPM version CI node version npm download

windows-style title bar component for Electron

Native Addon Demo

Web API Demo

Contributors


xudafeng


sriting

This project follows the git-contributor spec, auto updated at Wed Oct 19 2022 20:43:02 GMT+0800.

Installment

npm i electron-windows-titlebar --save-dev

Use Native Addons

const windowTitleBar = require('electron-windows-titlebar');
const win = new BrowserWindow({
  width: 800,
  height: 600,
  title: 'addon demo',
})
const hwnd = win?.getNativeWindowHandle();
const setDark = true;
if (hwnd) {
  setDark ? windowTitleBar.switchDarkMode(hwnd) : windowTitleBar.switchLightMode(hwnd);
}

Use Web APIs

// renderer process: import electron-windows-titlebar renderer
import TitleBar from 'electron-windows-titlebar/TitleBar';

<TitleBar
/>

Run Demo

npm run dev:web

another shell

npm run dev:main

License

The MIT License (MIT)

Package Sidebar

Install

npm i electron-windows-titlebar

Weekly Downloads

3

Version

1.0.7

License

MIT

Unpacked Size

134 kB

Total Files

10

Last publish

Collaborators

  • xudafeng
  • sriting