Vibary.ai
← Vibe Coding

Infinite Scroll Footer

A footer spinner fills a slot that was already reserved, and the next page fades in above it.

loadingsubtlecalmautomatic · finite · intermediate · ~1.4s
Variant

The animated component in this preview is rendered from the canonical file shown here. The surrounding demo shell only provides context and is not part of the copied code.

362 lines · react + motion only
import { useCallback, useEffect, useRef, useState } from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";

/**
 * Vibary · Infinite Scroll Footer
 *
 * The footer is the whole contract: a sentinel at the end of the list
 * asks for the next page, a spinner sits in a slot that is already

About this pattern

Pagination that never interrupts reading. A sentinel at the end of the list asks for the next page as it comes into view, the footer slot fills with a turning arc, and the arriving rows fade and lift into place a few tens of milliseconds apart so the eye can see where the list grew. The slot is a fixed height whether it holds a spinner, an end-of-results note or nothing at all — that constant is the whole trick, because a footer that grows and collapses drags the rows above it up and down and costs the reader their place. The spinner also resolves the ambiguity a bare list can't: the difference between more results coming and no more results existing.

Paginated feedFile browserSearch resultsComment thread