Tilt
Tilts its content in 3D in response to the pointer and device orientation
Source
LLM docs
Docs
Package
Usage
Tilt rotates its content in 3D in response to the pointer position and, on supported mobile
devices, the device orientation. 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 is based on the use-tilt hook. Use the hook directly if you need
full control over the transforms.
Tilt me
Tweak the props to see how the effect changes.
Layers
Use Tilt.Layer to build a layered depth effect. Each layer shifts towards the
pointer: depth prop controls how far (0 – static, 1 – full shift), shift prop sets
the full shift distance in px (20 by default). 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 Styles API
selector. To change it, pass a class 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 respects the prefers-reduced-motion setting: when reduced motion is requested,
the content does not tilt.
Device orientation
On supported mobile devices, Tilt reacts to the device orientation instead of the
pointer. On iOS 13+, access to device orientation requires a permission –
see the use-tilt documentation for details on requesting it.