Tilt
Tilts its content in 3D in response to the pointer and device orientation
Source
Package
Usage
Tilt rotates its content in 3D following the pointer. It is built on top of the
use-tilt hook, use the hook directly for full control over the transforms.
Wrap any element with a defined size:
Hover to tilt
The card reacts to your cursor and returns to its resting position on leave.
Tilt me
Tweak the props to see how the effect changes.
Layers
Use Tilt.Layer to build a depth effect. Each layer shifts towards the pointer,
depth prop controls how far it shifts: layers with a higher depth appear closer to the viewer:
Glare
Set withGlare to display a light reflection that follows the pointer:
Glare
A light reflection follows the pointer across the surface.
The reflection is the ::before pseudo-element of the glare selector, change it with classNames:
React to the whole page
By default, Tilt reacts only while the element is hovered. Set trackWindow to make it follow
the pointer anywhere on the page:
Move your cursor anywhere on the page
Reduced motion
Tilt does not tilt the content when the user has requested reduced motion.
Device orientation
On supported mobile devices, Tilt reacts to the device orientation instead of the pointer.
iOS requires a permission, see use-tilt for details.