---
title: "Flag Wave Gallery"
description: "A row of pictures that moves like a flag in the wind. Use it for fashion, art, and summer campaigns."
url: https://gelatinui.com/components/flag-wave-gallery
markdown_url: https://gelatinui.com/components/flag-wave-gallery.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/flag-wave-gallery"
version: "2026-11-24"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Flag Wave Gallery

> A row of pictures that moves like a flag in the wind. Use it for fashion, art, and summer campaigns.

Page: https://gelatinui.com/components/flag-wave-gallery

## When to use it

Best for: A fashion or summer campaign: a row of pictures ripples like cloth in the wind.

- Use `amplitude`, `waves`, and `flow` for the wave height, how many waves, and how fast they run.
- A drag sends larger waves through the row.

## When not to use it

- For soft cards that wobble after a drag, use [Jelly Gallery](https://gelatinui.com/components/jelly-gallery.md).
- For cards that fold like paper, use [Origami Gallery](https://gelatinui.com/components/origami-gallery.md).

## Notes for agents

- Each item needs `id`, `src`, `alt`, `title`, `meta`, and `text`. The caption shows `title` and `meta` of the front card.
- The root is a flex column, and the stage fills the rest of it: give the root a height, or give the stage one.
- With no WebGL, or with `renderer="css"`, the cards draw flat in CSS 3D. A cross-origin picture needs CORS headers.
- The pictures load when the gallery comes near the view, and it stops off screen.
- `drift` moves the cards at rest. `drive` takes a Motion value in cards (scroll or time); then the hand no longer moves it, and a drag stays with the page.
- `budget` (default 60) is the number of cards; it rounds up to whole copies of `items`.

## Anatomy

```text
FlagWaveGallery
```

## API reference

### FlagWaveGallery

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` | `readonly Readonly` |  |  |
| `drive` | `MotionValue<number>` |  | Moves the look from a value, in cards: 1.5 is halfway from card 1 to card 2. Use it for scroll or time. The hand no longer moves the look, and a drag stays with the page. |
| `finishes` | `readonly Readonly` |  | The finishes `finish` may switch between. The shaders hold all of them, so a switch fades and never builds the program again. A look item that offers a choice passes its choices. |
| `budget` | `number` |  | The number of cards in the look. It rounds up to whole copies of the items. |
| `cardAspect` | `number` |  | Card width / card height. Default: the one the look was made for. |
| `drift` | `number` |  | Cards per second while nobody touches the gallery. |
| `renderer` | `"auto" \| "css"` |  | `css` forces flat cards, as a page with no WebGL gets. |
| `cardScale` | `number` | 0.8 | The size of the cards on the flag. |
| `gap` | `number` | 0.04 | The space between the cards. |
| `amplitude` | `number` | 0.28 | How high the cloth lifts in a wave. |
| `waves` | `number` | 1.6 | The number of waves across the flag. |
| `flow` | `number` | 1 | How fast the waves run across the flag by themselves. |
| `finish` | `"clean" \| "glass" \| "melt" \| "pixel" \| "ripple" \| "smear"` | "clean" | The surface of the cards in motion: streaks of color (smear), glass, melt, pixel blocks, or ripples. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| FlagWaveGallery | `flag-wave-gallery` |  |  |  |

## Usage

Pass the cards as `items`, then place the stage and the caption parts. Give the root a height.

```tsx title="flag-wave-prints.tsx"
import { FlagWaveGallery, FlagWaveGalleryCaption, FlagWaveGalleryMeta, FlagWaveGalleryNext, FlagWaveGalleryPrevious, FlagWaveGalleryStage, FlagWaveGalleryTitle } from "@/components/pro/effects/flag-wave-gallery";

const PRINTS = [
  { id: "moon-field", title: "Moon Field", meta: "Print 06 · 50 × 70 cm", text: "Deep blues with a silver moon.",
    src: "/example-assets/night-sky-mountain-4x5.webp", alt: "Stars over a dark mountain" },
  { id: "maple", title: "Maple", meta: "Print 07 · 30 × 40 cm", text: "One tree in full autumn color.",
    src: "/example-assets/autumn-tree-4x5.webp", alt: "One maple tree in autumn color" },
  { id: "still", title: "Still", meta: "Print 08 · 40 × 50 cm", text: "A lake with no wind at all.",
    src: "/example-assets/mountain-lake-4x5.webp", alt: "A calm mountain lake at dawn" },
  { id: "low-cloud", title: "Low Cloud", meta: "Print 09 · 40 × 50 cm", text: "Green tops over white fog.",
    src: "/example-assets/misty-hills-4x5.webp", alt: "Green hills over valleys of fog" },
];

export function PrintsGallery() {
  return (
    <FlagWaveGallery items={PRINTS} className="h-[560px]">
      <FlagWaveGalleryStage />
      <FlagWaveGalleryCaption className="px-4 pb-4">
        <div className="min-w-0">
          <FlagWaveGalleryTitle />
          <FlagWaveGalleryMeta />
        </div>
        <div className="flex shrink-0 gap-2">
          <FlagWaveGalleryPrevious />
          <FlagWaveGalleryNext />
        </div>
      </FlagWaveGalleryCaption>
    </FlagWaveGallery>
  );
}
```

## 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/flag-wave-gallery
```

It adds 47 registry items: 43 files, 8522 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@phosphor-icons/react`, `@unpic/core`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## 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

- [Jelly Gallery](https://gelatinui.com/components/jelly-gallery.md)
- [Origami Gallery](https://gelatinui.com/components/origami-gallery.md)
- [Film Reel Gallery](https://gelatinui.com/components/film-reel-gallery.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves focus to the stage. The focus ring shows on the front card. |
| ← → | Moves to the card before or after. The arrows swap in a right-to-left page. |
| Home, End | Moves to the first or the last card. |

## Motion

| Part | Motion |
| --- | --- |
| Move | glide · Previous, Next, and the arrow keys move one card in about 0.46s; a far card takes up to 0.86s |
| Throw | glide · a drag release lands where the cards would be 320ms later, on the nearest card |
| Rest | progress · with `drift`, the cards move on their own, in cards a second; after a touch the drift waits 5s and eases back in |
| Wave | sine · the row ripples on its own, with no input; `flow` sets the speed and `amplitude` the height |
