Skip to content
Emulate OS X and Windows 10 window title bar
JavaScript CSS HTML
Branch: master
Clone or download
This branch is 30 commits ahead of kapetan:master.

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
dist
src
.gitignore
Gruntfile.js
README.md
package-lock.json
package.json

README.md

windowbar

Emulate OS X and Windows 10 window title bar. Based on kapetan/titlebar. See the demo.

NOTE: A React component version is available here.

npm install windowbar

Usage

For use in browserify, electron, or a similar environment. Plain javascript:

var windowbar = require('windowbar');

var wb = new windowbar({'style':'mac', 'dblClickable':false})
	.on('close', console.log('close'))
	.on('minimize', console.log('minimize'))
	.on('fullscreen', console.log('fullscreen'))
	.on('maximize', console.log('maximize'))
	.appendTo(document.body);

The returned instance emits four events: close, minimize, maximize, and fullscreen. Note: maximize can also be triggered in the Mac style by alt-clicking fullscreen.

The initializer function accepts an options object with these properties:

  • draggable (default true): Disable the -webkit-app-region CSS property on the root element. Allows frameless windows to be dragged in an electron application.
  • dblClickable (default true): Allows double clicking windowbar to trigger maximize event.
  • style (defaults to current OS, or generic if unrecognized): Possible values are mac, win, or generic.
  • dark (default false): Dark theme for Windows.

To do

  • Add generic style (similar to hyper)
You can’t perform that action at this time.