# M scroll swap text 3

> Testimonial quotes — pull quotes scroll into view one at a time

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/m-scroll-swap-text-3).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/m-scroll-swap-text-3
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/m-scroll-swap-text-3-light-43f083e6bfb47d8d.png
- Registry item: https://ui.cnippet.dev/r/m-scroll-swap-text-3.json
- Categories: scroll swap text
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/m-scroll-swap-text-3.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/scroll-swap-text`

## Files

### `registry/default/motion-variants/m-scroll-swap-text-3.tsx`

```tsx
"use client";
import { useRef } from "react";
import { ScrollSwapText } from "@/registry/default/motion/scroll-swap-text";

const quotes = [
  { author: "Sarah K.", text: "The animation quality is exceptional." },
  { author: "Marco R.", text: "Saved us weeks of development time." },
  { author: "Priya M.", text: "Our conversion rate jumped 30%." },
  { author: "Tom B.", text: "Best component library we have used." },
  { author: "Yuki T.", text: "The docs are incredibly clear." },
];

export default function ScrollSwapTextTestimonials() {
  const containerRef = useRef<HTMLDivElement>(null);

  return (
    <div className="flex min-h-50 items-center justify-center px-6">
      <div
        className="h-48 w-full max-w-sm overflow-y-scroll"
        ref={containerRef}
      >
        {quotes.map((q, i) => (
          <div
            className="border-border border-b px-1 py-5 last:border-0"
            key={i}
          >
            <ScrollSwapText
              as="p"
              className="text-base text-foreground italic"
              containerRef={containerRef}
            >
              {`"${q.text}"`}
            </ScrollSwapText>
            <p className="mt-1 text-muted-foreground text-sm">{q.author}</p>
          </div>
        ))}
      </div>
    </div>
  );
}
```
