custom-electron-titlebar

4.2.8last stable release 1 year ago
Complexity Score
Medium
Open Issues
18
Dependent Projects
26
Weekly Downloadsglobal
2,436

License

  • MIT
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

Custom Electron Titlebar

This project is a typescript library for electron that allows you to configure a fully customizable title bar.

[!IMPORTANT]
This project will no longer be maintained, because I am the only one working on it and I have no free time left to review the issues and incorporate new features or update the dependencies to the latest versions.

Thanks to all the contributors and dependents of this library.

📄 Documentation

Standard Title Bar

Bottom Menu Bar

Menu

Custom color

📦 Installing

You can install this package with npm, pnpm or yarn.

npm install custom-electron-titlebar
pnpm add custom-electron-titlebar
yarn add custom-electron-titlebar

🛠️ Usage

The implementation is done as follows:

In the main application file (main.js or .ts)

import { setupTitlebar, attachTitlebarToWindow } from "custom-electron-titlebar/main";

// setup the titlebar main process
setupTitlebar();

function createWindow() {
  // Create the browser window.
  const mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    //frame: false, // needed if process.versions.electron < 14
    titleBarStyle: 'hidden',
    /* You can use *titleBarOverlay: true* to use the original Windows controls */
    titleBarOverlay: true,
    webPreferences: {
      sandbox: false,
      preload: path.join(__dirname, 'preload.js')
    }
  });
  
  ...

  // attach fullScreen(f11 and not 'maximized') && focus listeners
  attachTitlebarToWindow(mainWindow);
}

In the preload file (preload.js or .ts)

import { Titlebar } from "custom-electron-titlebar";

window.addEventListener('DOMContentLoaded', () => {
  // Title bar implementation
  new Titlebar();
});

To see the options you can include in the Title Bar constructor, such as color of elements, icons, menu position, and much more, and the methods you can use, go to the wiki

💰 Support

If you want to support my development, you can do so by donating through 💖 Sponsor

📝 Contributors

I would like to express my sincere gratitude to all the people who have collaborated in the development and advancement of this project. I appreciate your contributions.

✅ License

This project is under the MIT license.

Dependencies

No runtime dependency information found for this package.

CVE IssuesActive
0
Scorecards Score
No Data
Test Coverage
No Data
Follows Semver
Yes
Github Stars
876
Dependenciestotal
22
DependenciesOutdated
7
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute custom-electron-titlebar in your own private NPM registry

npm config set registry  https://npm.cloudsmith.com/owner/repo
Processing...
Done
npm install custom-electron-titlebar
Processing...
Done

59 Releases

NPM on Cloudsmith

Getting started with NPM on Cloudsmith is fast and easy.