cnippet/ui
  1. motion
  2. scroll animations
  3. parallax floating

scroll animations

Parallax Floating

Elements float at different speeds based on cursor position, creating a depth illusion through independent parallax layers.

Installation

Usage

Anatomy

Good to know

  • ParallaxFloating fills its parent (absolute inset-0), so put it inside a sized container with position: relative.
  • Position each FloatingElement with className (left-*, top-*). Higher depth values move further with the cursor.
  • It reacts to the mouse, so there's no effect on touch screens.
  • When the user has turned on reduced motion, the elements stay in place and do not follow the cursor.

Props

ParallaxFloating

FloatingElement

Examples

Floating Shapes

Geometric shapes at varying depths follow the cursor, each moving at a different speed.

Floating Card

A card with floating glow blobs and dot accents at independent depth layers.

Floating Symbols

Abstract symbols drift at different depths — useful as decorative hero backgrounds.