---
title: Flow Art
description: Colour-block sections that swing in over each other as you scroll.
category: Scroll
tier: free
url: https://ui.dimaac.com/components/flow-art
registry: https://ui.dimaac.com/r/flow-art.json
---

# Flow Art

A stack of big editorial colour blocks. As you scroll, each new section swings in from a tilted angle around its bottom corner, like a page being turned, while the section before it stays pinned underneath. The swing is scrubbed to the scrollbar, so it swings back out when you scroll up. Tune the angle, the corner it pivots on, where on the screen it settles, and whether the old sections pin. It works on the page or inside any scrolling element through the scroller prop, handles sections taller than the screen, measures again when fonts and pictures arrive, and falls back to a plain coloured page when the visitor prefers reduced motion. Ported from the first DiMaac UI, with its site-only scroll context replaced by a scroller prop. Two small parts: FlowArt and FlowSection.

## Install

With the shadcn CLI:

```bash
npx shadcn@latest add https://ui.dimaac.com/r/flow-art.json
pnpm dlx shadcn@latest add https://ui.dimaac.com/r/flow-art.json
bunx --bun shadcn@latest add https://ui.dimaac.com/r/flow-art.json
```

With the `@dimaac` namespace in components.json: `npx shadcn@latest add @dimaac/flow-art`

Dependencies:

```bash
pnpm add gsap @gsap/react
npm install gsap @gsap/react
```

By hand:

1. Install the packages it uses: gsap, @gsap/react.
2. Copy the component file below into components/dimaac/flow-art.tsx.
3. It's styled with Tailwind v4 classes. If that folder sits outside the places Tailwind scans, add it with @source in your CSS.
4. Import it with import { FlowArt } from "@/components/dimaac/flow-art". Give its parent a size: it fills it.

## Usage

```tsx
import { FlowArt } from "@/components/dimaac/flow-art";

<FlowArt children={children} />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` (required) | `ReactNode` | - | The sections, in order. Use <FlowSection> for each one. |
| `angle` | `number` | `30` | How far each section is tilted before it swings in, in degrees. |
| `from` | `"left" \| "right"` | `"left"` | Which bottom corner the section swings around: the left one or the right one. |
| `settle` | `number` | `0.25` | Where on the screen the swing ends, as a fraction of the screen height from the top. 0.25 means a quarter of the way down. |
| `pin` | `boolean` | `true` | Keep every section pinned in place while the next one covers it. Off, they scroll away normally. |
| `smoothing` | `number` | `0` | How long the swing takes to catch up with the scrollbar, in seconds. 0 locks it to the scrollbar. |
| `scroller` | `string \| HTMLElement \| Window` | - | The scrolling element. Leave it out to use the page; give it a selector or an element for an inner scroller. |
| `className` | `string` | `""` | Extra classes for the outer wrapper. |

## Credits

- Modern Sculpture Display: rena, Lummi (https://www.lummi.ai/photo/modern-sculpture-display-y1he7), Lummi License
- Surreal 3D Planet Scene: Ricardo Matos, Lummi (https://www.lummi.ai/photo/surreal-3d-planet-scene-ofhhw), Lummi License
- Abstract Sculptural Objects: Dona Mara, Lummi (https://www.lummi.ai/photo/abstract-sculptural-objects-flp-3), Lummi License
- Vibrant Cylindrical Arrangement: SHIHO, Lummi (https://www.lummi.ai/photo/vibrant-cylindrical-arrangement-pj9pp), Lummi License
- Abstract Wavy Design: rena, Lummi (https://www.lummi.ai/photo/abstract-wavy-design-bypvi), Lummi License
- Glossy Pink Sphere: marisol, Lummi (https://www.lummi.ai/photo/glossy-pink-sphere-45si5), Lummi License

## Source

### flow-art.tsx → `components/dimaac/flow-art.tsx`

```tsx
"use client";

import { useRef, type CSSProperties, type ReactNode } from "react";
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { useGSAP } from "@gsap/react";

// Big colour-block sections that flow into each other. As you scroll, the next section swings in
// from a tilted angle (like a page being turned) while the section before it stays pinned underneath.
// Two small pieces:
//   <FlowArt>      wraps everything and runs the animation
//   <FlowSection>  one coloured panel. Put any content inside it.

if (typeof window !== "undefined") gsap.registerPlugin(useGSAP, ScrollTrigger);

export type FlowArtProps = {
  /** The sections, in order. Use <FlowSection> for each one. */
  children: ReactNode;
  /** How far each section is tilted before it swings in, in degrees. */
  angle?: number;
  /** Which bottom corner the section swings around: the left one or the right one. */
  from?: "left" | "right";
  /** Where on the screen the swing ends, as a fraction of the screen height from the top. 0.25 means a quarter of the way down. */
  settle?: number;
  /** Keep every section pinned in place while the next one covers it. Off, they scroll away normally. */
  pin?: boolean;
  /** How long the swing takes to catch up with the scrollbar, in seconds. 0 locks it to the scrollbar. */
  smoothing?: number;
  /** The scrolling element. Leave it out to use the page; give it a selector or an element for an inner scroller. */
  scroller?: string | HTMLElement | Window;
  /** Extra classes for the outer wrapper. */
  className?: string;
};

export function FlowArt({ children, angle = 30, from = "left", settle = 0.25, pin = true, smoothing = 0, scroller, className = "" }: FlowArtProps) {
  const rootRef = useRef<HTMLDivElement>(null);

  useGSAP(
    () => {
      const root = rootRef.current;
      if (!root) return;

      const mm = gsap.matchMedia();

      // Reduced motion: no tilting and no pinning. The sections are just a plain coloured page.
      mm.add("(prefers-reduced-motion: no-preference)", () => {
        const sections = gsap.utils.toArray<HTMLElement>("[data-flow-section]", root);
        // Swinging round the right corner means turning the other way
        const direction = from === "right" ? -1 : 1;
        const origin = from === "right" ? "bottom right" : "bottom left";

        sections.forEach((section, index) => {
          const panel = section.querySelector<HTMLElement>("[data-flow-panel]");
          if (!panel) return;

          // The first section is simply there. Every other one swings in while it climbs the screen.
          // scrub ties the swing to the scrollbar, so it swings back out when you scroll up.
          if (index > 0) {
            gsap.fromTo(
              panel,
              { rotation: angle * direction, transformOrigin: origin },
              {
                rotation: 0,
                ease: "none",
                force3D: true,
                scrollTrigger: { trigger: section, scroller, start: "top bottom", end: `top ${settle * 100}%`, scrub: smoothing > 0 ? smoothing : true },
              },
            );
          }

          // Hold the section still, with the next one sliding over the top of it. A section taller than
          // the screen pins by its bottom edge, so everything in it has been scrolled past first.
          if (pin && index < sections.length - 1) {
            ScrollTrigger.create({ trigger: section, scroller, start: "bottom bottom", end: "bottom top", pin: true, pinSpacing: false });
          }
        });

        // Fonts and pictures arriving late change the heights, so measure the pins again.
        // A short delay turns a burst of changes into one measurement.
        let measure: gsap.core.Tween | undefined;
        const measureSoon = () => {
          measure?.kill();
          measure = gsap.delayedCall(0.2, () => ScrollTrigger.refresh());
        };
        const observer = new ResizeObserver(measureSoon);
        // Only the wrapper: a pinned section changes its own box while it sticks, which must not re-trigger this
        observer.observe(root);
        let cancelled = false;
        document.fonts?.ready.then(() => {
          if (!cancelled) measureSoon();
        });

        return () => {
          cancelled = true;
          measure?.kill();
          observer.disconnect();
        };
      });

      return () => mm.revert();
    },
    { scope: rootRef, dependencies: [angle, from, settle, pin, smoothing, scroller], revertOnUpdate: true },
  );

  return (
    <div ref={rootRef} className={`relative w-full overflow-x-clip ${className}`}>
      {children}
    </div>
  );
}

export type FlowSectionProps = {
  /** What the section shows. */
  children: ReactNode;
  /** Extra classes for the coloured panel: the background, text colour and padding go here. */
  className?: string;
  /** Inline styles for the panel, e.g. a background colour. */
  style?: CSSProperties;
};

/** One coloured panel. It is the panel (not the section around it) that swings in, so the corners cut into the section below. */
export function FlowSection({ children, className = "", style }: FlowSectionProps) {
  return (
    <section data-flow-section className="relative w-full overflow-hidden">
      <div
        data-flow-panel
        className={`relative flex min-h-[100svh] w-full flex-col justify-between gap-6 px-[max(1.25rem,4vw)] pt-[max(2rem,4vw)] pb-[max(1.5rem,4vw)] ${className}`}
        style={{ transformOrigin: "bottom left", willChange: "transform", ...style }}
      >
        {children}
      </div>
    </section>
  );
}
```

### demo.tsx (the demo on the page, not installed)

```tsx
"use client";

import type { ReactNode } from "react";
import { FlowArt, FlowSection, type FlowArtProps } from "@/components/dimaac/flow-art";

// A maker's manifesto told in five colour blocks. The sections have their own fixed colours,
// so the effect reads the same in the light and the dark site theme.

const display = "font-[family-name:'Bebas_Neue',sans-serif]";

const headline = `${display} text-[clamp(3.5rem,12vw,14rem)] leading-[0.85] tracking-[-0.02em] uppercase`;
const lead = "max-w-[50ch] text-[clamp(1rem,2.5vw,2rem)] leading-[1.4]";

function Tag({ children }: { children: ReactNode }) {
  return <p className="text-[0.8rem] font-bold tracking-[0.2em] uppercase">{children}</p>;
}

function Rule({ strong = false }: { strong?: boolean }) {
  return <div aria-hidden="true" className={`my-[2vw] h-px w-full shrink-0 bg-current ${strong ? "" : "opacity-60"}`} />;
}

type Note = { label: string; text: string };

function Notes({ notes }: { notes: Note[] }) {
  return (
    <div className="flex flex-wrap gap-x-[3vw] gap-y-6">
      {notes.map((note) => (
        <div key={note.label} className="min-w-[180px] flex-1">
          <p className="mb-2 text-[0.85rem] font-bold tracking-[0.1em] uppercase">{note.label}</p>
          <p className="text-[clamp(0.85rem,1.3vw,1.05rem)] leading-normal opacity-75">{note.text}</p>
        </div>
      ))}
    </div>
  );
}

function Picture({ file, alt, className = "" }: { file: string; alt: string; className?: string }) {
  return <img src={media(file)} alt={alt} loading="lazy" decoding="async" draggable={false} className={`block w-full object-cover ${className}`} />;
}

export default function Demo(props: Partial<FlowArtProps>) {
  const { children: _children, className = "", ...settings } = props;
  return (
    <div className="font-[family-name:'Bricolage_Grotesque',sans-serif]">
      <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Bricolage+Grotesque:wght@400;600;700&display=swap" precedence="default" />

      <FlowArt {...settings} className={className}>
        <FlowSection style={{ backgroundColor: "#E85A2B", color: "#000" }}>
          <Tag>01 — Who we are</Tag>
          <Rule strong />
          <div className="flex flex-col gap-8 md:flex-row md:items-end md:justify-between">
            <h1 className={headline}>
              Create
              <br />
              Without
              <br />
              Limits
            </h1>
            <Picture
              file="art/orange-sculpture-1x1.jpg"
              alt="Minimalist sculpture with an orange oval shape on a wooden base in a modern interior"
              className="aspect-square max-w-[min(100%,420px)] md:w-[28vw] md:max-w-none"
            />
          </div>
          <Rule strong />
          <p className={`${lead} mt-auto`}>We believe good interfaces start with taste. No filler, no noise — just considered motion and the people who build it.</p>
        </FlowSection>

        <FlowSection style={{ backgroundColor: "#000", color: "#fff" }}>
          <Tag>02 — The idea</Tag>
          <Rule />
          <h2 className={headline}>
            Craft
            <br />
            First
            <br />
            Always
          </h2>
          <Rule />
          <div className="flex flex-col gap-8 md:flex-row md:items-end md:justify-between">
            <p className={lead}>A toolkit built for makers, by makers. Small pieces, each one finished, ready to copy into your own project.</p>
            <Picture
              file="art/floating-spheres-4x5.jpg"
              alt="Surreal 3D scene of a textured gray sphere with floating colourful spheres resembling planets"
              className="aspect-[4/5] max-w-[320px] md:w-[20vw]"
            />
          </div>
          <Rule />
          <Notes
            notes={[
              { label: "Pick", text: "Hand-chosen pieces that put real taste first. Every one is tested in the browser before it ships, and the best ones rise to the top." },
              { label: "Copy", text: "Take the code, not a dependency. Each piece is plain files you can read, change and make your own, with no lock-in." },
              { label: "Free", text: "Fair licensing. Clear terms. Free pieces stay free, and the paid ones are a one-time price with no hidden fees." },
            ]}
          />
          <Rule />
          <Notes
            notes={[
              { label: "Previews", text: "Every piece runs live in its own page. Open it full screen, scrub the settings and see exactly what you are getting." },
              { label: "Tuning", text: "Sliders for the numbers that matter. Change the timing, the ease or the radius, then copy the code that matches." },
              { label: "Notes", text: "Short, honest write-ups for every piece: what it does, what it needs and where it can break. No surprises later." },
            ]}
          />
          <Rule />
          <p className={`${lead} mt-auto self-end text-right`}>Every piece we build starts with one question — would we use this ourselves?</p>
        </FlowSection>

        <FlowSection style={{ backgroundColor: "#F5F0E8", color: "#000" }}>
          <Tag>03 — How it works</Tag>
          <Rule />
          <div className="flex flex-col gap-8 md:flex-row md:items-start md:justify-between">
            <h2 className={headline}>
              Show
              <br />
              Up.
              <br />
              Stand
              <br />
              Out.
            </h2>
            <div className="grid grid-cols-2 gap-3 md:w-[40vw] md:gap-[1.5vw]">
              <Picture file="art/organic-forms-4x5.jpg" alt="Abstract sculptural objects with organic and geometric forms in neutral tones with gold accents" className="aspect-[4/5]" />
              <Picture file="art/colour-cylinders-4x5.jpg" alt="Colourful cylindrical objects on a vibrant geometric background" className="mt-10 aspect-[4/5]" />
            </div>
          </div>
          <Rule />
          <p className={lead}>Three steps. Zero complexity. Your interface starts moving the moment you paste it in.</p>
          <Rule />
          <Notes
            notes={[
              { label: "01 — Browse", text: "Scroll the library, hover to see a piece move and open any of them in its own page in a single click." },
              { label: "02 — Adjust", text: "Tune the settings live until it feels right. Everything you change is written into the snippet as you go." },
              { label: "03 — Install", text: "One command, or copy the files by hand. It lands in your project as plain, readable code." },
            ]}
          />
          <Rule />
          <Notes
            notes={[
              { label: "04 — Restyle", text: "Colours, fonts and spacing come from your own tokens, so a piece takes on the look of your site." },
              { label: "05 — Combine", text: "Pieces are small and independent. Mix a few on one page and they still behave." },
              { label: "06 — Update", text: "When a piece improves, the changes are listed, so you can pull in what you want and skip the rest." },
            ]}
          />
        </FlowSection>

        <FlowSection style={{ backgroundColor: "#1A3DE8", color: "#fff" }}>
          <Tag>04 — The aim</Tag>
          <Rule />
          <h2 className={headline}>
            Future
            <br />
            Of
            <br />
            Motion
          </h2>
          <Rule />
          <p className={lead}>We're not just building a library. We're raising the bar.</p>
          <Rule />
          <Notes
            notes={[
              { label: "Readable", text: "Plain code with sensible names, so the next person understands it in a minute." },
              { label: "Fast", text: "Only transforms and clip-paths move, so everything stays smooth on an average phone." },
              { label: "Yours", text: "No account, no tracking, no strings. Take it and build what you like." },
            ]}
          />
          <Rule />
          <Picture file="art/blue-wave-lines-16x9.jpg" alt="Abstract wavy lines in teal and blue on a deep blue background" className="aspect-[16/9] max-h-[48svh] md:aspect-[21/8]" />
          <Rule />
          <p className={lead}>Most motion on the web is heavy, copied and never quite right. We're here to change that — one careful piece at a time.</p>
          <Rule />
          <Notes
            notes={[
              { label: "Open door", text: "No invite codes. No waiting lists. If you build for the web, you belong here." },
              { label: "Every screen", text: "Phones, tablets and big monitors, with touch and keyboard handled from day one." },
              { label: "Fair terms", text: "Use it in client work and commercial projects. Pro pieces are a single payment, forever." },
            ]}
          />
        </FlowSection>

        <FlowSection style={{ backgroundColor: "#E8E02B", color: "#000" }}>
          <Tag>05 — Join us</Tag>
          <Rule />
          <div className="flex flex-col gap-8 md:flex-row md:items-end md:justify-between">
            <h2 className={headline}>
              Ready
              <br />
              To
              <br />
              Begin?
            </h2>
            <Picture
              file="art/pink-sphere-1x1.jpg"
              alt="A glossy pink sphere reflecting a dreamy sky with clouds"
              className="aspect-square max-w-[420px] rounded-full md:w-[26vw] md:max-w-none"
            />
          </div>
          <Rule />
          <p className={`${lead} mt-auto`}>Take control of your interface. Pick a piece, paste it in and let's make the web feel better together.</p>
        </FlowSection>
      </FlowArt>
    </div>
  );
}
```

## Agent prompt

```text
Add the Flow Art component (<FlowArt />) from DiMaac UI to this project.

Docs: https://ui.dimaac.com/components/flow-art
Source and dependencies (shadcn registry JSON): https://ui.dimaac.com/r/flow-art.json

Install it with:
npx shadcn@latest add https://ui.dimaac.com/r/flow-art.json

Then use it like this:
import { FlowArt } from "@/components/dimaac/flow-art";
<FlowArt children={children} />

If the shadcn CLI isn't set up here, fetch the registry JSON above, write files[0].content to components/dimaac/flow-art.tsx and install gsap, @gsap/react.
It uses Tailwind v4 classes, so make sure Tailwind scans that folder. Give its parent a size: it fills it. Keep light and dark mode working and keep its prefers-reduced-motion fallback.
Full index for agents: https://ui.dimaac.com/llms.txt
```
