# electron-windows-titlebar

> windows-style title bar component for Electron

Latest version **1.0.7** (published 2022-12-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install electron-windows-titlebar
pnpm add electron-windows-titlebar
yarn add electron-windows-titlebar
bun add electron-windows-titlebar
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2022-12-11 |
| First published | 2022-09-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 130.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 24 |
| Maintainers | xudafeng, sriting |
| Keywords | electron, windows, title-bar |

## Links

- npm: https://www.npmjs.com/package/electron-windows-titlebar
- Repository: https://github.com/electron-modules/electron-windows-titlebar
- Homepage: https://github.com/electron-modules/electron-windows-titlebar#readme
- Issues: https://github.com/electron-modules/electron-windows-titlebar/issues
- npm.io page: https://npm.io/package/electron-windows-titlebar

## Dependencies (2)

- [bindings](https://npm.io/package/bindings.md) ^1.5.0
- [node-addon-api](https://npm.io/package/node-addon-api.md) ^3.0.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2022-12-11
- 1.0.6 — 2022-12-08
- 1.0.5 — 2022-12-08
- 1.0.4 — 2022-12-08
- 1.0.3 — 2022-12-07
- 1.0.1 — 2022-12-07
- 1.0.0 — 2022-12-07
- 0.1.7 — 2022-10-19
- 0.1.6 — 2022-09-06
- 0.1.5 — 2022-09-06
- 0.1.3 — 2022-09-06
- 0.1.2 — 2022-09-06
- 0.1.1 — 2022-09-06
- 0.1.0 — 2022-09-06

## 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=_8-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

<p align="center">
  <img
    src="./addon-demo.gif"
    width="480"
  />
</p>

## Web API Demo

<p align="center">
  <img
    src="./demo.gif"
    width="480"
  />
</p>



<!-- GITCONTRIBUTOR_START -->

## Contributors

|[<img src="https://avatars.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub>](https://github.com/xudafeng)<br/>|[<img src="https://avatars.githubusercontent.com/u/17586742?v=4" width="100px;"/><br/><sub><b>sriting</b></sub>](https://github.com/sriting)<br/>|
| :---: | :---: |


This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Wed Oct 19 2022 20:43:02 GMT+0800`.

<!-- GITCONTRIBUTOR_END -->

## 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';

<TitleBar
/>
```

## Run Demo

```shell
npm run dev:web
```

another shell
```shell
npm run dev:main
```

## License

The MIT License (MIT)

---
_Source: https://npm.io/package/electron-windows-titlebar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
