react-position-transformer
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

React Position Transformer 📐

npm Build Status code style: prettier Netlify Status

Performantly transform one element's position to an others! 🚀

Demo

Usage:

import * as React from 'react';
import Transformer from 'react-position-transformer';
 
class MyComponent extends React.Component {
  destRef = React.createRef();
 
  render() {
    return (
      <React.Fragment>
        <div ref={this.destRef}>
          dest
        </div>
        <Transformer
          transition={300}
          transformed={this.props.transformed}
          destRef={this.destRef.current}
        >
          <div>src</div>
        </Transformer>
      </React.Fragment>
    );
  }
}

src will be "moved" (via css transforms) to dest when transformed === true.

Package Sidebar

Install

npm i react-position-transformer

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

7.95 kB

Total Files

8

Last publish

Collaborators

  • iamjoshellis