Rotate Velocity Scroll

element go spin and based on scroll velocity and more cooler

Loading...

Installation

npx shadcn@latest add http://localhost:3000/labs/r/rotate-velocity-scroll.json
yarn dlx shadcn@latest add http://localhost:3000/labs/r/rotate-velocity-scroll.json
pnpx shadcn@latest add http://localhost:3000/labs/r/rotate-velocity-scroll.json
bunx shadcn@latest add http://localhost:3000/labs/r/rotate-velocity-scroll.json

Usage

page.tsx
import { ScrollVelocityRotate } from "@/components/rotate-velocity-scroll";
import { Star } from "lucide-react";

export default function Page() {
  return (
    <ScrollVelocityRotate baseVelocity={30} className="inline-block">
      <Star className="inline-block text-yellow-400" size={64} />
    </ScrollVelocityRotate>
  );
}

API Reference

ScrollVelocityRotate

Prop

Type