A github desktop style title bar component for electron.
npm i --save electron-react-titlebar
You should have electron installed first.
electron app
import { TitleBar } from 'electron-react-titlebar'
import 'electron-react-titlebar/assets/style.css'
ReactDOM.render(
<TitleBar menu={menuTemplate} icon={iconPath} />,
document.querySelector('title-bar')
)
ReactDOM.render(
<TitleBar menu={menuTemplate} icon={iconPath}>
<link rel="stylesheet" type="text/css" href={require.resolve('electron-react-titlebar/assets/style.css')} />
</TitleBar>,
document.body
)
Elements to be rendered in between the menu and the window controls (optional).
Disable minimize button (optional).
Disable maximize button (optional).
Path to icon file (optional).
The browserWindow Object that window controls affect to. Default value is remote.currentWindow()
(optional).
Menu template of Electron's Menu (optional).
Note: electron-react-titlebar is supporting a subset of Electron's MenuItem.
Supported options:
click
- supportedtype
-submenu
is not supported.label
- supportedenabled
- supportedvisible
- supportedchecked
- supported