electron-windows-titlebar
v1.0.7
Published
windows-style title bar component for Electron
Downloads
16
Readme
electron-windows-titlebar
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)