Skip to content

Reflow States Section

A pinned section that re-lays four modules into three layouts at scroll checkpoints, all at once in 380ms, and since each layout orders them differently the rule's break passes to the new third, overlapping its left-hand neighbour.

ProBroken Grideditorial

This is a viberdy Pro component

The live preview, the props panel and the write-up are open to everyone. The full source, the AI prompt and CLI install are part of Pro.

Preview

Practice

Four practices. Three layouts. One rule.

01 / 01

Identity

Names, marks and the grid everything else stands on.

02 / 02

Type

Faces chosen or drawn, and one scale to set them.

03 / 03

Motion

How the layout moves when the content does.

04 / 04

Web

Sites built on the same rule, in React.

Layout 01 / 03 · Line · Motion is third, so it breaks

Props

No runtime dependencies
"use client";

import { createContext, useContext, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
import type { CSSProperties, ReactNode, RefObject } from "react";

/**
 * ReflowStatesSection — four modules across three layouts, changed by the scroll at checkpoints.
 *
 * The section pins; at a third and two thirds of the way (with hysteresis)
 * the four modules re-lay into the next layout, all at once in 380ms, and
 * since each layout orders them differently, the break passes to the new
 * third, which overlaps its left-hand neighbour. The scroll only picks a
 * layout; nothing is scrubbed. Buttons move to each layout. Inside a
 * scrolling frame, pass `scroller` or provide ScrollRootContext.
 *
 * Part of the Broken Grid kit: a Klein-blue field #2416f0, paper plates
 * #f1f0e8, ink #0a0a1f, and acid #e2ff3a only where a rule fires. One rule,
 * "The Third": every third module in a run overshoots its leading edge by two

  // ---------------------------------------------------------------
  // Full source available with a viberdy Pro subscription.
  // https://viberdy.dev/pricing
  // ---------------------------------------------------------------
}
Notes

About this section

A studio's practices told by the layout itself. The section pins while the page scrolls through it; at a third and at two thirds of the way (with a small hysteresis, so a scroll parked on a checkpoint can't flicker) the four modules, Identity, Type, Motion and Web, re-lay into the next layout, all at once in 380ms: a line, a turn, then a stair. Each layout puts them in a different order, so a different module is third each time, and the break goes with the position: the new third grows two gutters out over its left-hand neighbour and takes the bracket while the old one lets go. Since the order changes, it suits things without a fixed order: practices, services, principles. The scroll only ever picks a layout; nothing is scrubbed, and a jump straight to the end lands on the last layout. Numbered buttons move to each layout, and an optional readout says which module is breaking. Hold one layout with `state`.

Curator’s note

The Broken Grid kit's feature section (slot 7), cut from broken-grid-site. Pro: a pinned scroll section driving a stateful three-layout system (grid placements per state, FLIP between them, the rule recomputed per layout) with the lattice ticks.

Related

Pairs well with

Matched on shared tags and category — the entries most likely to be used alongside this one.

NewPro

The sunrise laid out on a timeline and scrubbed by the scroll: the section pins, 05:30 to 07:00 runs with the scroll, the lamp rendered live rises along its curve, and the time, colour, output and phase follow.

sectionscrollscrub
NewPro

Engagements as plates on the lattice: an intro with a Project / Retainer toggle, then three plans; flip the toggle and the plans re-order in 380ms, the prices change, and the rule's break passes to the new third.

pricingsectiontoggle
New

The kit's rule for any list: items become plates on the lattice and every third breaks; filter, sort or add and everything moves from where it was in 380ms while the break passes to whichever item is now third.

animationfliplayout animation