1.0.7 • Published 4 years ago

tilt-react-wrapper v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

tilt-react-wrapper

Basic usage

import { Tilt } from "tilt-react-wrapper";
//...
export default function () {
  return (
    <Tilt>
      <div className="tilt">
        <h1>Hello tilt</h1>
      </div>
    </Tilt>
  );
}

You should add the 'tilt' className in the child components you want the effect to work on

Passing props

import { Tilt } from "tilt-react-wrapper";
//...
export default function () {
  return (
    <Tilt 
      glare={true} 
      revert={true}
    >
      <div className="tilt">
        <h1>Hello tilt</h1>
      </div>
    </Tilt>
  );
}

All available props and it's default values

{
  reverse: false,
  max: 35,
  startX: 0,
  startY: 0,
  perspective: 1000,
  scale: 1,
  speed: 300,
  transition: true,
  axis: null,
  reset: true,
  easing: "cubic-bezier(.03,.98,.52,.99)",
  glare: false,
  maxGlare: 1,
  glarePrerender: false,
  mouseEventElement: null,
  gyroscope: true,
  gyroscopeMinAngleX: -45,
  gyroscopeMaxAngleX: 45,
  gyroscopeMinAngleY: -45,
  gyroscopeMaxAngleY: 45,
}

You can check out the vanilla-tilt documentation for more information about config props

Callback functions still not supported

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago