Lab // Index

Total: 07

Component // Scroll

02 of 07

Dia FooterNew

A Dia-style rubber-band footer: pull past the end of the page and it lifts on a spring while columns of blurred colour stretch up from the floor, then wobble back

Demo // Live

Interactive

Scroll past the end of this card, or play the rubber band from here.

Tip: keep scrolling after you hit the bottom.

Install // Steps

Total: 01

Step 01

Copy and paste the following code into your project.

Two files: the React component and the canvas engine it drives. No dependencies beyond React.

import { StretchyFooter } from "@/components/craft/stretchy-footer";

// On a full page: binds to the window and lifts the element marked data-stretchy-page
export default function Page() {
  return (
    <>
      <main data-stretchy-page>{/* your page */}</main>
      <StretchyFooter
        windowScroll
        colors={["#F1FCFD", "#CAF0F8", "#90E0EF", "#48CAE4", "#00B4D8", "#0096C7", "#0077B6", "#023E8A", "#03045E"]}
        maxStretch={220}
      />
    </>
  );
}

// Or as its own scroll area
<StretchyFooter className="h-96">
  <YourContent />
</StretchyFooter>

Spec // Features

Total: 06
  • 01

    Works with wheel, trackpad and touch

    Trackpad momentum is read as letting go, so the stretch never sticks

  • 02

    A spring per column

    The edge columns are softer than the middle, so the top edge ripples as it snaps back

  • 03

    Three ways to mount

    On the window, on a scroll container you already have, or as its own scroll area

  • 04

    Idle unless stretched

    Nothing is drawn and no frame is requested while the page is at rest

  • 05

    Respects reduced motion

    Overscroll does nothing; only an explicit play still runs

  • 06

    Any palette, column count, blur and stiffness

Spec // Props

Total: 12
Dia Footer props
PropTypeDefaultDescription
colorsstring[]9 coloursGradient stops, top of each column to the floor
maxStretchnumber280Peak stretch, in px
columnsnumber9How many columns, stepping down from the middle
blurnumber16Blur on the columns, in px
glownumber0White bloom on the floor, 0 to 1
stiffnessnumber380Spring stiffness
dampingnumber32Spring damping
flipbooleanfalseTall edges and a dipped middle
rotate0 | 1800180 hangs the columns from the lifted page
windowScrollbooleanfalseBind to the window, for a full page
scrollRefRefObject-Bind to a scroll container you already have
contentSelectorstring[data-stretchy-page]What lifts with the stretch, for the two modes above