Skip to content

react-component/align

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ed36112 · Aug 18, 2024
Aug 18, 2024
Aug 17, 2024
Dec 19, 2022
Dec 17, 2022
Dec 16, 2022
Jul 24, 2015
Oct 8, 2019
Dec 16, 2022
Dec 16, 2022
Sep 21, 2020
Jun 4, 2018
Dec 21, 2016
Oct 16, 2023
Jul 24, 2015
Dec 16, 2022
Oct 8, 2019
Aug 15, 2024
Jan 8, 2023

Repository files navigation

rc-align


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

NPM version npm download build status Codecov bundle size dumi

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.