https://github.com/electron-modules/electron-windows-titlebar
windows-style title bar component for Electron
https://github.com/electron-modules/electron-windows-titlebar
electron titlebar windows
Last synced: 10 months ago
JSON representation
windows-style title bar component for Electron
- Host: GitHub
- URL: https://github.com/electron-modules/electron-windows-titlebar
- Owner: electron-modules
- Created: 2022-09-06T05:52:26.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-15T16:08:01.000Z (over 3 years ago)
- Last Synced: 2025-08-09T05:26:32.554Z (11 months ago)
- Topics: electron, titlebar, windows
- Language: TypeScript
- Homepage:
- Size: 376 KB
- Stars: 24
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# electron-windows-titlebar
---
[![NPM version][npm-image]][npm-url]
[![CI][CI-image]][CI-url]
[![node version][node-image]][node-url]
[![npm download][download-image]][download-url]
[npm-image]: https://img.shields.io/npm/v/electron-windows-titlebar.svg
[npm-url]: https://npmjs.org/package/electron-windows-titlebar
[CI-image]: https://github.com/electron-modules/electron-windows-titlebar/actions/workflows/ci.yml/badge.svg
[CI-url]: https://github.com/electron-modules/electron-windows-titlebar/actions/workflows/ci.yml
[node-image]: https://img.shields.io/badge/node.js-%3E=_16-green.svg
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/dm/electron-windows-titlebar.svg
[download-url]: https://npmjs.org/package/electron-windows-titlebar
> windows-style title bar component for Electron
## Native Addon Demo
## Web API Demo
## Contributors
|[
xudafeng](https://github.com/xudafeng)
|[
sriting](https://github.com/sriting)
|[
snapre](https://github.com/snapre)
|
| :---: | :---: | :---: |
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Sun Dec 11 2022 23:02:29 GMT+0800`.
## Installment
```shell
npm i electron-windows-titlebar --save-dev
```
## Use Native Addons
```javascript
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
```javascript
// renderer process: import electron-windows-titlebar renderer
import TitleBar from 'electron-windows-titlebar/TitleBar';
```
## Run Demo
```shell
npm run dev:web
```
another shell
```shell
npm run dev:main
```
## License
The MIT License (MIT)