$ gnpm install rc-align
React Align Component. Wrapper around https://github.com/yiminghe/dom-align.
npm install
npm start
http://localhost:8100/examples/
online example: http://react-component.github.io/align/examples/
var Align = require('rc-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
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 || { pageX: number, pageY: number } || { clientX: number, clientY: number } | function(){return window;} | a function which returned value or point is used for target from https://github.com/yiminghe/dom-align |
monitorWindowResize | Boolean | false | whether realign when window is resized |
rc-align is released under the MIT license.
Copyright 2013 - present © cnpmjs.org | Home |