Docs/Scroll Based Velocity

Scroll Based Velocity

Text that scrolls across the screen and speeds up based on the user's scroll velocity.

Installation

$pnpm dlx shadcn@latest add @componentry/scroll-based-velocity

Usage

API Reference

PropTypeDefault
textThe text to display and scroll.
string—
default_velocityThe base speed of the scrolling.
number5
classNameClasses to style the text element.
string—

Click on the icon in the top right of the example preview to view the source code for specific variants.

Keep in mind

This component is inspired by various open-source projects and patterns. Please verify licenses and implementation details before using in production.

Have any questions?
Contact on@harshjdhv
Scroll to see the effect
Velocity ScrollVelocity ScrollVelocity ScrollVelocity ScrollVelocity ScrollVelocity ScrollVelocity ScrollVelocity Scroll
Velocity ScrollVelocity ScrollVelocity ScrollVelocity ScrollVelocity ScrollVelocity ScrollVelocity ScrollVelocity Scroll
import { ScrollBasedVelocity } from "@/components/ui/scroll-based-velocity";

<ScrollBasedVelocity
  text="Velocity Scroll"
  default_velocity={5}
  className="font-display text-center text-4xl font-bold tracking-[-0.02em] text-foreground drop-shadow-sm md:text-7xl md:leading-[5rem]"
/>