# M scroll swap text 1

> Feature list — each item slides in as the scrollable container is scrolled

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

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

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

const features = [
  "Zero-config setup",
  "Spring physics built-in",
  "Accessible by default",
  "TypeScript first",
  "Tree-shakeable exports",
  "Server component ready",
];

export default function ScrollSwapTextFeatureList() {
  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 rounded-lg border border-border"
        ref={containerRef}
      >
        {features.map((feature) => (
          <ScrollSwapText
            as="div"
            className="border-border border-b px-5 py-4 font-medium text-base last:border-0"
            containerRef={containerRef}
            key={feature}
          >
            {feature}
          </ScrollSwapText>
        ))}
      </div>
    </div>
  );
}
```
