0.1.4 • Published 9 years ago

react-window-kit v0.1.4

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

react-window-kit

Kit for creating window component.

Install

npm install --save react-window-kit

Usage

As window needs some common component to control window, like button, icon, etc. React-Window-Kit doesn't offer these component, it needs to integrate with other UI component library. For example, react-bootsrap-window

Example

Execute npm run test, then check http://localhost:3000/

API

Window

nametypedefaultdescription
visibleBooleanfalsewhether show window
positionObject{align: 'cc', offset: [0, 0]}Align option values: tr, tc, tl, cl, cc, cr, bl, bc, br.
sizeObjectwidth, height
closableBooleantrue
maximizableBooleanfalse
backdropBooleantrue
keyboardBooleantrue
animationBoolean/ReactComponent
onAlignfunction
onShownfunction
onHidefunction
onHiddenfunction
closeReactElementclose button
restoreReactElementrestore button
maximizeReactElementmaximize button

Modal

nametypedefaultdescription
visibleBooleanfalsewhether show modal
sizeStringmdfl: full screen, lg, md, sm
headerReactElement
footerReactElement
onHidefunction

Confirm

nametypedefaultdescription
visibleBooleanfalsewhether show confirm
titleString
onCancelfunction
onOkfunction
signReactElementsign icon
cancelReactElementcancel button
okReactElementok button

Tip

nametypedefaultdescription
visibleBooleanfalsewhether show Tip
typeStringinfoinfo, success, warning, danger
titleString
onOkfunction
signObjecttip sign icon. {info: ReactElement, success: ReactElement, warning: ReactElement, danger: ReactElement}
okReactElementok button

Feature

  • support IE8,IE8+, Chrome, Firefox, Safari

Todo

  1. auto focus
  2. ESC shortcut

License

react-window-kit is released under the MIT license.