https://github.com/react-component/m-align
Abstract React Align for mobile
https://github.com/react-component/m-align
Last synced: 4 months ago
JSON representation
Abstract React Align for mobile
- Host: GitHub
- URL: https://github.com/react-component/m-align
- Owner: react-component
- License: mit
- Created: 2017-09-21T03:19:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-26T21:18:38.000Z (over 4 years ago)
- Last Synced: 2025-08-12T02:39:21.321Z (5 months ago)
- Language: TypeScript
- Size: 309 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE.md
Awesome Lists containing this project
README
# rmc-align
---
React Align Component. Wrapper around https://github.com/yiminghe/dom-align.
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![gemnasium deps][gemnasium-image]][gemnasium-url]
[![node version][node-image]][node-url]
[![npm download][download-image]][download-url]
[npm-image]: http://img.shields.io/npm/v/rmc-align.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rmc-align
[travis-image]: https://img.shields.io/travis/react-component/m-align.svg?style=flat-square
[travis-url]: https://travis-ci.org/react-component/m-align
[coveralls-image]: https://img.shields.io/coveralls/react-component/m-align.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/react-component/m-align?branch=master
[gemnasium-image]: http://img.shields.io/gemnasium/react-component/m-align.svg?style=flat-square
[gemnasium-url]: https://gemnasium.com/react-component/m-align
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/dm/rmc-align.svg?style=flat-square
[download-url]: https://npmjs.org/package/rmc-align
## 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
[](https://npmjs.org/package/rmc-align)
## Usage
```js
var Align = require('rmc-align');
var ReactDOM = require('react-dom');
ReactDOM.render(
, 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
## License
rmc-align is released under the MIT license.