windows-style title bar component for Electron
xudafeng |
sriting |
snapre |
---|
This project follows the git-contributor spec, auto updated at Sun Dec 11 2022 23:02:29 GMT+0800
.
npm i electron-windows-titlebar --save-dev
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);
}
// renderer process: import electron-windows-titlebar renderer
import TitleBar from 'electron-windows-titlebar/TitleBar';
<TitleBar
/>
npm run dev:web
another shell
npm run dev:main
The MIT License (MIT)