Skip to content
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples fix forceAlign miss focus in IE (#21) Feb 14, 2019
src fix forceAlign miss focus in IE (#21) Feb 14, 2019
tests align check the element size change Jun 21, 2018
.editorconfig 1.0 Jul 24, 2015
.gitignore
.travis.yml up Jun 9, 2017
HISTORY.md
LICENSE.md Added LICENSE.md Dec 21, 2016
README.md
index.js 1.0 Jul 24, 2015
package.json bump 2.4.5 Feb 14, 2019

README.md

rc-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.github.io/align/examples/

Feature

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

Keyboard

install

rc-align

Usage

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

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 || { 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

License

rc-align is released under the MIT license.

You can’t perform that action at this time.