# Scroll Velocity Text

> A marquee line that speeds up and leans with how fast the page scrolls.

Source: https://www.honestui.com/docs/animated/scroll-velocity-text

```tsx
"use client";

import { ScrollVelocityText } from "@/registry/default/animated/scroll-velocity-text";

export function ScrollVelocityTextDemo() {
  return (
    <div className="flex w-full flex-col gap-4 py-6">
      <ScrollVelocityText
        rows={[
          "Design with intent",
          <span key="care" className="text-muted-foreground">
            Ship with care
          </span>,
        ]}
        className="[mask-image:linear-gradient(to_right,transparent,black_8%,black_92%,transparent)]"
      />
      <p className="text-center text-xs text-muted-foreground">Scroll the page to speed it up.</p>
    </div>
  );
}

```

## Overview [#overview]

Scroll Velocity Text drifts one or more rows of large text sideways, alternating direction from row to row. When the page scrolls the rows speed up and lean into the scroll, then ease back to their resting pace. Use it as a section divider or a closing line on a marketing page, where the words are a flourish rather than information.

Each row repeats as many times as it needs to fill its width, so the loop never shows a gap at any size.

## Installation [#installation]

<CliBlock commands="[&#x22;scroll-velocity-text&#x22;]" />

## Usage [#usage]

```tsx
import { ScrollVelocityText } from "@/components/animated/scroll-velocity-text"

<ScrollVelocityText rows={["Design with intent", "Ship with care"]} />
```

The rows follow the nearest scrolling ancestor, or the page when there is none. Pass `scrollContainer` to choose the element yourself:

```tsx
const panelRef = useRef<HTMLDivElement>(null)

<div ref={panelRef} className="h-96 overflow-y-auto">
  <ScrollVelocityText scrollContainer={panelRef} rows={["Now showing"]} />
  …
</div>
```

## Accessibility [#accessibility]

Screen readers get each row once, in order, from a visually hidden copy. The moving copies are hidden from them, so the repeats are never read out.

The rows stop while they are offscreen. With reduced motion enabled they stay still and upright, one copy per row; scrolling has no effect. Set `pauseOnHover` to hold the rows while the pointer is over them.

## API Reference [#api-reference]


  ### `rows`

type: `ReactNode[]`

Rows of text. Children are used, one row each, when omitted.

  ### `velocity`

type: `number` · default: `60`

Resting speed in CSS pixels per second.

  ### `scrollFactor`

type: `number` · default: `4`

How much scrolling speeds the rows up. 0 ignores scrolling.

  ### `skew`

type: `number` · default: `8`

Largest lean in degrees while scrolling fast. 0 keeps the text upright.

  ### `separator`

type: `ReactNode` · default: `a small dot`

Placed between repeats of a row.

  ### `scrollContainer`



">
    Element whose scrolling drives the effect. Defaults to the nearest scrolling ancestor, or the page.

  ### `pauseOnHover`

type: `boolean` · default: `false`

Holds the rows still while the pointer is over them.

  ### `className`

type: `string`

Class for the root element.

  ### `rowClassName`

type: `string`

Class for the text of every row, such as a different size.
