Lab // Index
Total: 07Component // Scroll
02 of 07Dia 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
InteractiveScroll past the end of this card, or play the rubber band from here.
Tip: keep scrolling after you hit the bottom.
Install // Steps
Total: 01Step 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| Prop | Type | Default | Description |
|---|---|---|---|
| colors | string[] | 9 colours | Gradient stops, top of each column to the floor |
| maxStretch | number | 280 | Peak stretch, in px |
| columns | number | 9 | How many columns, stepping down from the middle |
| blur | number | 16 | Blur on the columns, in px |
| glow | number | 0 | White bloom on the floor, 0 to 1 |
| stiffness | number | 380 | Spring stiffness |
| damping | number | 32 | Spring damping |
| flip | boolean | false | Tall edges and a dipped middle |
| rotate | 0 | 180 | 0 | 180 hangs the columns from the lifted page |
| windowScroll | boolean | false | Bind to the window, for a full page |
| scrollRef | RefObject | - | Bind to a scroll container you already have |
| contentSelector | string | [data-stretchy-page] | What lifts with the stretch, for the two modes above |