---
title: "Video Scrub"
description: "A pinned section where a muted video plays as the page scrolls, forward and back, and holds still when the scroll stops."
url: https://gelatinui.com/components/video-scrub
markdown_url: https://gelatinui.com/components/video-scrub.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/video-scrub"
version: "2026-11-10"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Video Scrub

> A pinned section where a muted video plays as the page scrolls, forward and back, and holds still when the scroll stops.

Page: https://gelatinui.com/components/video-scrub

## When to use it

Best for: A short clip with real motion that a person plays with the scroll, forward and back.

- Encode the clip with a keyframe on every frame (`ffmpeg … -g 1 -movflags +faststart`), so each seek is quick.
- Give `VideoScrubVideo` a `poster`: it shows until the clip loads, and when `disabled`.
- Put the heading and the call to action in `VideoScrubContent`: it holds still while the clip plays.
- In a scroll box, pass the box as `container` and set its height with `--parallax-view`.

## When not to use it

- For a sequence of still pictures, use [Frame Scrub](https://gelatinui.com/components/frame-scrub.md).
- For layers that move at their own speed, use [Parallax](https://gelatinui.com/components/parallax.md).

## Notes for agents

- The root is three views tall (`h-[calc(var(--parallax-view,100svh)*3)]`); the stage sticks for the extra two views.
- One seek runs at a time and the latest time wins, so a fast scroll never queues seeks.
- A clip with normal keyframes lags and jumps: each seek decodes from the last keyframe.
- The clip is always muted and inline, and never plays on its own. Give it an `aria-label` when it says something.
- Near the view, a clip with no frame yet plays and pauses at once, because iOS Safari ignores `preload`.
- `disabled` shows the poster and does no seek work.

## Anatomy

```text
VideoScrub
├─ VideoScrubVideo (0..n)
└─ VideoScrubContent (0..n)
```

## API reference

### VideoScrub

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `container` | `RefObject<HTMLElement \| null>` |  | The scroll box, when the item scrolls inside one and not with the page. |
| `disabled` | `boolean` | false | Rests every layer and stops the work. |

### VideoScrubVideo

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `src` | `string` |  | The clip. Encode it with a keyframe on every frame (`-g 1`): see the doc comment. |
| `poster` | `string` |  | The still picture before the clip loads, and the look when `disabled`. |
| `fit` | `"contain" \| "cover"` | "cover" | `cover` (default) crops the clip to fill the stage; `contain` shows the whole frame. |

### VideoScrubContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `scrim` | `boolean` | true | A dark fade from the bottom under the text, so it reads on any frame. Default true. Without it, give the text its own backdrop. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| VideoScrub | `video-scrub` |  | `--parallax-pin-top`, `--parallax-view` |  |
| VideoScrubVideo | `video-scrub-video` |  |  |  |
| VideoScrubContent | `video-scrub-content` |  |  |  |

## Usage

Give the clip and its poster. Put the text over it in the content part.

```tsx title="harbour-show.tsx"
import {
  VideoScrub,
  VideoScrubContent,
  VideoScrubVideo,
} from "@/components/pro/effects/video-scrub";

export function HarbourShow() {
  return (
    <VideoScrub>
      <VideoScrubVideo src="/fireworks.mp4" poster="/fireworks.webp" />
      <VideoScrubContent>
        <h2 className="text-4xl font-medium">Twelve minutes of light</h2>
      </VideoScrubContent>
    </VideoScrub>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/video-scrub
```

It adds 26 registry items: 25 files, 4076 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Parallax](https://gelatinui.com/components/parallax.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Parallax](https://gelatinui.com/components/parallax.md)
- [Parallax Image](https://gelatinui.com/components/parallax-image.md)
- [Image](https://gelatinui.com/components/image.md)

## Accessibility

The clip is decorative and takes no focus. Give it an `aria-label` when it says something.

The content holds still on the stage, so a focus that lands in it is always in sight.

## Motion

| Part | Motion |
| --- | --- |
| Scroll | none · the clip time follows the scroll, one seek at a time, with no easing |
