# react-native-anchor-point

> I provide a util function to inject anchor point, or called pivot point into your transform object, to achieve 3D transform animation in React-Native. This is similar to web transform-origin in React-Native.

Latest version **1.0.6** (published 2021-11-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-anchor-point
pnpm add react-native-anchor-point
yarn add react-native-anchor-point
bun add react-native-anchor-point
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2021-11-13 |
| First published | 2020-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 209 |
| Author | RongyanZheng |
| Maintainers | rongyan.zheng |
| Keywords | react-native, transform origin, 3d transform, anchor point, pivot point |

## Links

- npm: https://www.npmjs.com/package/react-native-anchor-point
- Repository: https://github.com/sueLan/react-native-anchor-point
- Homepage: https://github.com/sueLan/react-native-anchor-point#readme
- Issues: https://github.com/sueLan/react-native-anchor-point/issues
- npm.io page: https://npm.io/package/react-native-anchor-point

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

- 1.0.6 (latest) — 2021-11-13
- 1.0.5 — 2021-06-13
- 1.0.4 — 2021-06-13
- 1.0.3 — 2021-05-08
- 1.0.2 — 2021-04-03
- 1.0.1 — 2020-05-14
- 1.0.0 — 2020-05-14

## README

# react-native-anchor-point


Provide a simple, tricky but powerful function, `withAnchorPoint` , like Anchor Point in iOS, Pivot Point in Android, `transform-origin` in css to achieve better 3D transform animation in React-Native. 

> Make the 3D transform easier in React Native

![](./res/rotateZ.gif)
![](./res/rotateXY.gif)
![](./res/rotate.gif)

## Getting Started 

install the `react-native-anchor-point` 

```
yarn add react-native-anchor-point
```
or 
```
npm install react-native-anchor-point
```

## Example 

```javascript
import { withAnchorPoint } from 'react-native-anchor-point';

getTransform = () => {
    let transform = {
        transform: [{ perspective: 400 }, { rotateX: rotateValue }],
    };
    return withAnchorPoint(transform, { x: 0.5, y: 0 }, { width: CARD_WIDTH, height: CARD_HEIGHT });
};
    
<Animated.View style={[styles.blockBlue, this.getTransform()]} />
```

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