JSPM

windows10-fluently-titlebar

3.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q39494F
  • License MIT

Add Windows 10-style Modern UI titlebars to Electron-based desktop applications

Package Exports

  • windows10-fluently-titlebar

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (windows10-fluently-titlebar) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

windows10-fluently-titlebar

Adds CSS-based Windows 10 Modern UI title bars to any Electron-based desktop app.

screen

Installation

$ npm install --save windows10-fluently-titlebar

API

Importing the module

const ElectronTitlebarWindows = require('windows10-fluently-titlebar');

Creating a new instance

The module takes a single optional options argument and exports the TitleBar class:

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.

titlebar.appendTo(contextElement);
  • (optional) contextElement - HTMLElement - Default: document.body - Element to which to add the titlebar

#destroy

Removes the Title Bar.

titlebar.destroy();

Events

TitleBar emits the following events:

  • minimize
  • maximize
  • fullscreen
  • close
titlebar.on('close', function(e) {
    console.log('close');
});