2.0.0 • Published 6 years ago
react-windowbar v2.0.0
react-windowbar
Emulate OS X and Windows 10 window title bar.
Forked from katacarbix/windowbar.
See the demo or examples/index.html.
Installation
$ yarn add react-windowbarUsage
For use with webpack, browserify, electron, or a similar environment. As a React component:
import Windowbar from 'react-windowbar';
<Windowbar
onClose={() => console.log('close')}
onDoubleClick={() => console.log('double click')}
onMinimize={() => console.log('minimize')}
onMaximize={() => console.log('maximize')}
onFullscreen={() => console.log('fullscreen')}
/>By default, the user's current OS style is used. To specify something specific, use the style prop.
The component optionally takes five event handlers: onClose, onDoubleClick, onFullscreen, onMaximize, and onMinimize.
Note:
onMaximizecan also be triggered in the Mac style by alt-clicking the full screen button.
The component accepts options as attributes with these names:
style(defaults to current OS, orgenericif unrecognized): Possible values aremac,windows, orgeneric.draggable(defaulttrue): Disable the -webkit-app-region CSStransparent(defaultfalse): Whether or not the Windowbar background should be transparentdark(defaultfalse): Dark theme for Windows. property on the root element. Allows frameless windows to be dragged in anelectronapplication.doubleClickable(defaulttrue): Allows double clicking Windowbar to trigger maximize event.
To do
- Add generic style (similar to hyper)
2.0.0
6 years ago