# M scroll swap text 2

> Step-by-step process — numbered steps swap in as they cross the scroll threshold

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-2).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/m-scroll-swap-text-2
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/m-scroll-swap-text-2-light-45f4dc37482c43a3.png
- Registry item: https://ui.cnippet.dev/r/m-scroll-swap-text-2.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-2.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-2.tsx`

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

const steps = [
  { label: "Install the package", num: "01" },
  { label: "Add the component", num: "02" },
  { label: "Configure your theme", num: "03" },
  { label: "Deploy to production", num: "04" },
  { label: "Measure the impact", num: "05" },
  { label: "Iterate and improve", num: "06" },
];

export default function ScrollSwapTextSteps() {
  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}
      >
        {steps.map((step) => (
          <div
            className="flex items-center gap-4 border-border border-b py-5 last:border-0"
            key={step.num}
          >
            <span className="w-8 shrink-0 font-mono text-muted-foreground text-sm">
              {step.num}
            </span>
            <ScrollSwapText
              className="font-medium text-base"
              containerRef={containerRef}
            >
              {step.label}
            </ScrollSwapText>
          </div>
        ))}
      </div>
    </div>
  );
}
```
