https://github.com/sidneys/electron-titlebar-windows
Adds the Windows 10 ModernUI (Metro)-style titlebars to any Electron-based desktop app.
https://github.com/sidneys/electron-titlebar-windows
Last synced: about 1 year ago
JSON representation
Adds the Windows 10 ModernUI (Metro)-style titlebars to any Electron-based desktop app.
- Host: GitHub
- URL: https://github.com/sidneys/electron-titlebar-windows
- Owner: sidneys
- License: mit
- Created: 2016-09-10T12:35:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-09-20T01:21:53.000Z (over 5 years ago)
- Last Synced: 2025-05-07T18:08:42.916Z (about 1 year ago)
- Language: JavaScript
- Size: 187 KB
- Stars: 140
- Watchers: 9
- Forks: 23
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# electron-titlebar-windows
**Adds CSS-based Windows 10 Modern UI title bars to any Electron-based desktop app.**

# Installation
```
$ npm install --save electron-titlebar-windows
```
# API
### Importing the module
```js
const ElectronTitlebarWindows = require('electron-titlebar-windows');
```
### Creating a new instance
The module takes a single optional `options` argument and exports the `TitleBar` class:
```js
const titlebar = new ElectronTitlebarWindows(options);
```
Properties of `options`:
- (optional) **darkMode** - `String` - **Light titlebar buttons (for dark backgrounds)**
- (optional) **color** - `String` - **Icon color (Hex)**
- (optional) **backgroundColor** - `String` - **Bar color (Hex)**
- (optional) **draggable** - `Boolean` - **Titlebar enables dragging of contained window**
- (optional) **fullscreen** - `Boolean` - **Resize button initializes in fullscreen mode**
### Methods
#### #appendTo
Shows the Title Bar.
```js
titlebar.appendTo(contextElement);
```
- (optional) **contextElement** - `HTMLElement` - Default: `document.body` - **Element to which to add the titlebar**
#### #destroy
Removes the Title Bar.
```js
titlebar.destroy();
```
### Events
`TitleBar` emits the following events:
- `minimize`
- `maximize`
- `fullscreen`
- `close`
```js
titlebar.on('close', function(e) {
console.log('close');
});
```
## License
MIT © [sidneys](http://sidneys.github.io)
## Related
Based on [titlebar](https://github.com/kapetan/titlebar)