# M parallax floating 1

> Floating shapes — geometric shapes at different depths follow the cursor

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/m-parallax-floating-1).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/m-parallax-floating-1
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/m-parallax-floating-1-light-efc3c1596aaa61da.png
- Registry item: https://ui.cnippet.dev/r/m-parallax-floating-1.json
- Categories: parallax floating
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/m-parallax-floating-1.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/parallax-floating`

## Files

### `registry/default/motion-variants/m-parallax-floating-1.tsx`

```tsx
import {
  FloatingElement,
  ParallaxFloating,
} from "@/registry/default/motion/parallax-floating";

export default function ParallaxFloatingShapes() {
  return (
    <div className="relative flex min-h-50 items-center justify-center overflow-hidden rounded-xl bg-gradient-to-br from-violet-500/5 via-transparent to-indigo-500/5">
      <ParallaxFloating sensitivity={1}>
        <FloatingElement className="top-[15%] left-[8%]" depth={0.5}>
          <div className="h-10 w-10 rounded-xl border border-violet-500/20 bg-violet-500/10" />
        </FloatingElement>
        <FloatingElement className="top-[20%] right-[12%]" depth={1.5}>
          <div className="h-5 w-5 rounded-full bg-pink-500/30" />
        </FloatingElement>
        <FloatingElement className="bottom-[20%] left-[15%]" depth={2.5}>
          <div className="h-7 w-7 rotate-45 rounded-md bg-indigo-500/20" />
        </FloatingElement>
        <FloatingElement className="right-[8%] bottom-[25%]" depth={1}>
          <div className="h-12 w-12 rounded-2xl bg-sky-500/15" />
        </FloatingElement>
        <FloatingElement className="top-[10%] left-[40%]" depth={3}>
          <div className="h-3 w-3 rounded-full bg-emerald-500/40" />
        </FloatingElement>
      </ParallaxFloating>
      <div className="relative z-10 text-center">
        <p className="font-semibold text-muted-foreground text-xs uppercase tracking-widest">
          Move your cursor
        </p>
        <h2 className="mt-1 font-bold text-2xl text-foreground">
          Depth in motion
        </h2>
        <p className="mt-1 text-muted-foreground text-sm">
          Each layer floats at a different speed
        </p>
      </div>
    </div>
  );
}
```
