# rc-align

> align ui component for react

Latest version **4.0.15** (published 2022-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install rc-align
pnpm add rc-align
yarn add rc-align
bun add rc-align
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.15 |
| Published | 2022-12-19 |
| First published | 2015-07-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 29 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 82 |
| Maintainers | yesmeck, afc163, yiminghe, zombiej |
| Keywords | react, react-component, react-align, align |

## Links

- npm: https://www.npmjs.com/package/rc-align
- Repository: https://github.com/react-component/align
- Homepage: http://github.com/react-component/align
- Issues: http://github.com/react-component/align/issues
- npm.io page: https://npm.io/package/rc-align

## Dependencies (5)

- [rc-util](https://npm.io/package/rc-util.md) ^5.26.0
- [dom-align](https://npm.io/package/dom-align.md) ^1.7.0
- [classnames](https://npm.io/package/classnames.md) 2.x
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.10.1
- [resize-observer-polyfill](https://npm.io/package/resize-observer-polyfill.md) ^1.5.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 4.0.15 (latest) — 2022-12-19
- 5.0.0-0 — 2023-10-16
- 4.0.14 — 2022-12-17
- 4.0.13 — 2022-12-16
- 4.0.12 — 2022-04-26
- 4.0.11 — 2021-08-11
- 4.0.10 — 2021-08-10
- 4.0.9 — 2020-11-05
- 4.0.8 — 2020-09-24
- 4.0.7 — 2020-09-21
- 4.0.6 — 2020-09-21
- 4.0.5 — 2020-09-21
- 4.0.4 — 2020-09-17
- 4.0.3 — 2020-08-21
- 4.0.2 — 2020-08-17
- … 35 more at https://npm.io/package/rc-align/versions

## README

# rc-align
---

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

[![NPM version][npm-image]][npm-url]
[![build status][github-actions-image]][github-actions-url]
[![Codecov][codecov-image]][codecov-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/rc-align.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-align
[github-actions-image]: https://github.com/react-component/align/workflows/CI/badge.svg
[github-actions-url]: https://github.com/react-component/align/actions
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/align/master.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/react-component/align/branch/master
[gemnasium-image]: http://img.shields.io/gemnasium/react-component/align.svg?style=flat-square
[gemnasium-url]: https://gemnasium.com/react-component/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/rc-align.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-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

[![rc-align](https://nodei.co/npm/rc-align.png)](https://npmjs.org/package/rc-align)

## Usage

```js
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

<table class="table table-bordered table-striped">
    <thead>
    <tr>
        <th style="width: 100px;">name</th>
        <th style="width: 50px;">type</th>
        <th style="width: 50px;">default</th>
        <th>description</th>
    </tr>
    </thead>
    <tbody>
        <tr>
          <td>align</td>
          <td>Object</td>
          <td></td>
          <td>same with alignConfig from https://github.com/yiminghe/dom-align</td>
        </tr>
        <tr>
          <td>onAlign</td>
          <td>function(source:HTMLElement, align:Object)</td>
          <td></td>
          <td>called when align</td>
        </tr>
        <tr>
          <td>target</td>
          <td>
              function():HTMLElement || 
              { pageX: number, pageY: number } ||
              { clientX: number, clientY: number }
          </td>
          <td>function(){return window;}</td>
          <td>
            a function which returned value or point is used for target from https://github.com/yiminghe/dom-align
        </td>
        </tr>
        <tr>
          <td>monitorWindowResize</td>
          <td>Boolean</td>
          <td>false</td>
          <td>whether realign when window is resized</td>
        </tr>
    </tbody>
</table>


## License

rc-align is released under the MIT license.

---
_Source: https://npm.io/package/rc-align · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
