Cursor-tracking parallax layer that translates children based on mouse position with smooth lerp.
Smoothed translate3d follow with configurable strength
Invert mode to repel its content from the cursor
GPU-accelerated via will-change-transform
Status
stable
Category
parallax
Since
v1.6.0
API
import { PixelMouseParallax } from '@pxlkit/ui-kit';
Prop
Type
Default
Description
children* (required)
React.ReactNode
—
The content that moves with the pointer.
strength
number
20
Max travel distance in px.
invert
boolean
false
If true, moves away from cursor instead of towards.
className
string
—
Extra classes on the wrapper.
style
React.CSSProperties
—
Inline styles of the wrapper.
ref points to <div>.
Accessibility
WCAG target: 2.1 AA
decorative-motion
Pointer-only effect with no keyboard or assistive impact. The layer holds still when the user prefers reduced motion (prefers-reduced-motion: reduce), and stops where it is if the preference turns on while it moves.