titlebar-react
Emulate OS X window title bar. Extracted from mafintosh/playback and then forked from kapetan/titlebar.
See the live demo (Without React).
npm install titlebar-react
var React = ;var Titlebar = ; var Window = React; // then simply add to DOMReact;
Usage
The returned instance emits four events: close
, minimize
, fullscreen
(each corresponding to one of the stoplight buttons) and maximize
when double clicking on the title bar area, or holding down alt key and clicking fullscreen
.
Instead of emitting four events, you get to define what each event will do by passing callbacks to this.props.
<Titlebar handleClose=thishandleClose handleMinimize=thishandleMinimize handleMaximize=thishandleMaximize handleFullScreen=thishandleFullScreen />
available props
draggable
(defaultfalse
): Enable dragging.handleClose
: called when close is clickedhandleMinimize
: called when minimized is clickedhandleMaximize
: called when maximize is clickedhandleFullScreen
: called when fullscreen is clicked