Skip to content

react-component-enhance/align

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rce-align


React Align Component. Wrapper around https://github.com/yiminghe/dom-align.

NPM version build status Test coverage gemnasium deps node version npm download

Development

npm install
npm start

Example

http://localhost:8100/examples/

online example: http://react-component-enhance.github.io/align/examples/

Feature

  • support ie8,ie8+,chrome,firefox,safari

Keyboard

install

rce-align

Usage

var Align = require('rce-align');
var ReactDOM = require('react-dom');
ReactDOM.render(<Align align={{}} target={function(){}}><div></div></Align>, container);

will align child with target when mounted or align is changed

API

props

name type default description
align Object same with alignConfig from https://github.com/yiminghe/dom-align
onAlign function(source:HTMLElement, align:Object) called when align
target function():HTMLElement function(){return window;} a function which returned value is used for target from https://github.com/yiminghe/dom-align
monitorWindowResize Boolean false whether realign when window is resized
monitorWindowScroll Boolean false whether realign when window is scrolled, do not support old ie before ie 9

License

rce-align is released under the MIT license.