Scroll Velocity Text
Rows of repeated text that drift in alternating directions and react to the scroll: they speed up, flip direction, lean and stretch with it. Rows can be grabbed and thrown, paused on hover, outlined on alternate rows and faded at the edges.
pixikit.com/docs/effects/scroll-velocity-text
Customize
Velocity100
Color
Font size80px
Font weight
Skew with velocity0°
Scale with velocity0.00
Draggable
Outline alternate
Gap0px
Damping50
Stiffness400
Num copies6
Separator
Fade edges
Pause on hover
Props
25| Name | Type | Default | Description |
|---|---|---|---|
scrollContainerRef | RefObject<HTMLElement | null> | None | A ref to a custom scroll container. Leave it out to use the page. |
texts | ReactNode[] | [] | The rows. Each item is repeated across its row; strings, elements and icons all work. |
velocity | number | 100 | The base speed, in pixels per second. The direction flips for odd rows. |
color | string | None | The text colour of the rows. Follows the surrounding text when left out. |
fontSize | number | string | None | The size of the row text. Numbers are pixels. |
fontWeight | number | string | None | The weight of the row text. |
skewWithVelocity | number | 0 | How far the rows lean into their motion at full speed, in degrees. |
scaleWithVelocity | number | 0 | How much taller the rows stretch at full speed, as a fraction of their height. Negative squashes them. |
draggable | boolean | false | Lets people grab a row to scrub it, then throw it to glide on. |
outlineAlternate | boolean | false | Draws every other row as outlined text. |
gap | number | 0 | Extra space between the repeated copies, in pixels. |
damping | number | 50 | The damping of the spring that smooths the scroll speed. |
stiffness | number | 400 | The stiffness of the spring that smooths the scroll speed. |
numCopies | number | 6 | How many copies of the text each row repeats. |
separator | ReactNode | "" | Shown between the repeated copies, like a dot or a slash. Empty leaves a space. |
fadeEdges | boolean | false | Fades the rows out at the left and right edges. |
pauseOnHover | boolean | false | Glides a row to a stop while the pointer is over it. |
velocityMappingInput | number[] | [0, 1000] | The scroll speed range, in pixels per second, that maps to the multiplier range. |
velocityMappingOutput | number[] | [0, 5] | The speed multiplier range the scroll speed maps to. |
parallaxClassName | string | "parallax" | Extra class names for each row. |
scrollerClassName | string | "scroller" | Extra class names for the moving track of each row. |
parallaxStyle | CSSProperties | None | Inline styles for each row. |
scrollerStyle | CSSProperties | None | Inline styles for the moving track of each row. |
className | string | None | |
style | CSSProperties | None |