@electron-boilerplate/titlebar

Custom rendered titlebars with electron-boilerplate

Usage no npm install needed!

<script type="module">
  import electronBoilerplateTitlebar from 'https://cdn.skypack.dev/@electron-boilerplate/titlebar';
</script>

README

@electron-boilerplate/titlebar

Renders color titlebars in Electron on Windows and optionally on macOS

windows example

mac example

Usage

This library is primarily designed for use with electron-boilerplate which simplifies running code across the Electron main and renderer processes.

npm install electron-boilerplate @electron-boilerplate/titlebar

In your main process simply:

const { ElectronBoilerplate } = require('electron-boilerplate');
const { customTitlebar } = require('@electron-boilerplate/titlebar');

ElectronBoilerplate
  .standardConfiguration()
  .use(customTitlebar('darkblue'))
  .run();

customTitlebar parameters

Parameter Type Description Default
color string Titlebar background color '#3f51b5'
colorBarOnMac boolean Also custom draw a colored titlebar on macOS true
showTitle boolean Display the page title in the titlebar true
appendTo string Query selector used to find element to insert titlebar into. If undefined (the default), then a flex layout is automatically added for you undefined (auto add flex layout)