@gfazioli/mantine-parallax
A Mantine component that allows you to create the famous Apple TV parallax effect.
Installation
After installation import package styles at the root of your application:
You can import styles within a layer @layer mantine-parallax by importing @gfazioli/mantine-parallax/styles.layer.css file.
Usage
Despite the Parallax component allowing you to create the famous Apple TV Card effect, you can use this component to manipulate the perspective and rotation of an element. It is also possible to act on the skew of the element and disable the parallax effect when hovering with the mouse. See Initial values and Skew below.
The disabled prop allows you to disable the effect. Both perspective and initialPerspective props will be disabled if the value is greater or equal to 10000.
The component supports touch interactions on mobile devices out of the box. You can disable touch support by setting touchEnabled={false}.
The component automatically respects the prefers-reduced-motion media query. When the user has enabled reduced motion in their OS settings, all animations and hover/touch effects are disabled.
You can customize the transition behavior with transitionDuration (in milliseconds, default 300) and transitionEasing (default 'ease-out'). The hoverScale prop (default 1) applies a scale transform when hovering — try values like 1.05 for a subtle zoom effect.
The onRotationChange callback fires whenever the rotation changes, receiving { rotateX, rotateY, isHovering }. Use it to synchronize external effects (shadows, text, other components) with the parallax rotation.
Set resetOnLeave={false} to keep the last rotation position when the mouse leaves instead of resetting to the initial values. The invertRotation prop reverses the tilt direction — the card tilts away from the cursor instead of toward it. Use maxRotation to clamp the rotation to a maximum degree value, useful for achieving subtle effects with high threshold values.
Enable gyroscopeEnabled to use the DeviceOrientation API on mobile devices — the card will tilt based on physical device orientation. On iOS 13+, permission is automatically requested on the first tap. Adjust gyroscopeSensitivity (default 1) to control how much device tilt translates into card rotation.
Keyboard Interaction
Set keyboardEnabled to enable keyboard-driven tilt. When focused (via Tab), use arrow keys to tilt the card and Escape to reset. The component automatically adds tabIndex, focus styles, and ARIA attributes (role="group", aria-roledescription="parallax card"). Adjust keyboardStep (default 5) to control degrees per keypress. Works with springEffect for bouncy keyboard-driven movement.

Norway Fjord Adventures
With Fjord Tours you can explore more of the magical fjord landscapes with tours and activities on and around the fjords of Norway
Initial values and Skew
You can set the initial rotation of the card using the initialPerspective, initialRotationX, initialRotationY, and initialRotationZ props.
You may also use the initialSkewX and initialSkewY props to set the initial skew of the card.

Norway Fjord Adventures
With Fjord Tours you can explore more of the magical fjord landscapes with tours and activities on and around the fjords of Norway
Scroll
The initial values of the Parallax component can be set based on the scroll position. You can use the useWindowScroll() hook to get the scroll position and pass it to the Parallax component.

Norway Fjord Adventures
With Fjord Tours you can explore more of the magical fjord landscapes with tours and activities on and around the fjords of Norway
Simple usage
Below a super simple example of how to use the Parallax component.
Parallax
Amazing parallax effect component. Hover to see the effect.
Parallax Effects
In addition to the classic Apple TV Card effect, you can use the Parallax component to create a parallax effects both for the background and for the content. You may use the backgroundParallax and backgroundParallaxThreshold props to enable and manage the parallax effect.
Background
Here is an example of the parallax effect used for the background.
Parallax.Layer
The Parallax.Layer compound component provides a cleaner way to create content parallax effects. Each layer has a depth prop that controls how much it moves relative to the card rotation — higher values move more.
Depth 1
Parallax Layers
Each layer moves at a different speed based on its depth.
Hover me!
Content (legacy)
You can also use the contentParallax and contentParallaxDistance props to enable content parallax. This approach uses cloneElement internally and applies depth based on child index. For more control, prefer Parallax.Layer.
Parallax
Amazing parallax effect component. Hover to see the effect.
Example: Complex
Below a more complex example of how to use the Parallax component.
Parallax
Amazing parallax effect component. Hover to see the effect.
Spring Physics
Enable springEffect to replace CSS transitions with spring-based physics animation. The card movement becomes more natural, with overshoot and oscillation. Adjust springStiffness (default 150, higher = snappier) and springDamping (default 12, higher = less bounce) to fine-tune the feel. Works with all effects including shadow, light, glare, and Parallax.Layer.

Norway Fjord Adventures
With Fjord Tours you can explore more of the magical fjord landscapes with tours and activities on and around the fjords of Norway
Glare Effect
The glareEffect prop adds a reflective glare that follows the cursor, simulating a glossy surface. You can customize it with glareColor, glareMaxOpacity, glareSize, and glareOverlay. Combine it with lightEffect and shadowEffect for the full Apple TV Card experience.

Norway Fjord Adventures
With Fjord Tours you can explore more of the magical fjord landscapes with tours and activities on and around the fjords of Norway
Example: Dynamic Shadow
The shadowEffect prop enables a dynamic shadow that moves opposite to the card rotation, simulating a light source from above. You can customize it with shadowColor, shadowBlur, and shadowOffset.

Dynamic Shadow
Enable shadowEffect and tilt the card to see the shadow follow the rotation.
Example: onRotationChange
The onRotationChange callback receives { rotateX, rotateY, isHovering } on every rotation update. You can use it to synchronize external UI elements, drive animations, or display debug info.
Hover this card
The rotation values are displayed below in real time.
X: 0.0° Y: 0.0°Example: Shadow
Give free rein to your creativity. You can use the Parallax component to create shading effects.
Parallax
Amazing parallax effect component. Hover to see the effect.
Example: Presentation
A more complete example showing how multiple features can be combined to create engaging presentation cards.

Norway Fjord Adventures
With Fjord Tours you can explore more of the magical fjord landscapes with tours and activities on and around the fjords of Norway

Norway Fjord Adventures
With Fjord Tours you can explore more of the magical fjord landscapes with tours and activities on and around the fjords of Norway

Norway Fjord Adventures
With Fjord Tours you can explore more of the magical fjord landscapes with tours and activities on and around the fjords of Norway