Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-next-tilt

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-next-tilt - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "react-next-tilt",
"private": false,
"version": "0.0.1",
"version": "0.0.2",
"description": "A Performant Customizable Tilt Component for React",

@@ -6,0 +6,0 @@ "main": "./dist/react-next-tilt.umd.cjs",

@@ -52,3 +52,3 @@ <h1 align="center">

- No jittery movement around the edges
- Built with performance in mind (`useAnimationFrame()`, `will-change`, and other optimizations)
- Built with performance in mind (`requestAnimationFrame()`, `will-change`, and other optimizations)
- Built from the ground up using React Hooks/TypeScript (is not a port of another library)

@@ -113,3 +113,3 @@ - Minimum amount of component re-renders

The components's ref object contains these properties:
The component's ref object contains these properties:

@@ -123,3 +123,3 @@ <table aria-hidden="false"><thead><tr><th><span>Name</span></th><th><span>Description</span></th><th><span>Parameters</span></th></tr><tbody><tr><td><span>element</span></td><td><div><span>The component's main container element</span></div><div><div><code><span>HTMLDivElement | null</span></code></div><td><div><span>-</span></div></td></td></tr><tr><td><span>tilt</span></td><td><div><span>Tilts the component to the given angle</span></div><div><div><code><span>(angle: Angle, changeScale?: boolean) => void</span></code></div><td><div><span><code>angle</code>: Tilt angle ({angleX: number, angleY: number})</span></div><div><span><code>changeScale=false</code>: Whether to apply the scale property or not</span></div></td></td></tr><tr><td><span>reset</span></td><td><div><span>Resets the component (rotation/scale and glare effects)</span></div><div><div><code><span>() => void</span></code></div><td><div><span>-</span></div></td></td></tr><tr><td><span>reset</span></td><td><div><span>Returns the current tilt angle ({angleX: number, angleY: number})</span></div><div><div><code><span>() => Angle</span></code></div><td><div><span>-</span></div></td></td></tr><tr><td><span>updateWillChange</span></td><td><div><span>Adds/Removes the "will-change" CSS property to the tilt and glare elements</span></div><div><span>note: Can improve performance when doing a series of animations using the "TiltRef.tilt()" function</span><div><div><code><span>(add?: boolean) => void</span></code></div><td><div><span><code>add=true</code>: Whether to add the property (true) or remove it (false)</span></div></td></td></tr></tbody></table>

```ts
import { Tilt, TiltRef } from 'react-next-tilt';
import { Tilt } from 'react-next-tilt';

@@ -126,0 +126,0 @@ const MyComponent = () => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc