Minimal footer with progress
A slim footer whose 'Back to top' button is a ring that fills as you scroll the page, beside a sliding theme of social links.
"use client";
import { useEffect, useRef, useState, type CSSProperties } from "react";
import "./minimal-footer.css";
const LINKS = ["Work", "About", "Journal", "Contact"];
const SOCIAL = ["Instagram", "LinkedIn", "Dribbble"];
/** Find the nearest scrolling parent (the page, or a scrolling box like a preview stage). */
function scrollParent(el: HTMLElement | null): HTMLElement | Window {
for (let p = el?.parentElement; p; p = p.parentElement) {
const o = getComputedStyle(p).overflowY;
if ((o === "auto" || o === "scroll") && p.scrollHeight > p.clientHeight)
return p;
}
return window;
}
/**
* MinimalFooter
* - Reads scroll progress of its scroll parent and draws it as a ring around the back-to-top button.
*/
export function MinimalFooter({
theme = "light",
}: {
theme?: "light" | "dark";
}) {
const root = useRef<HTMLElement>(null);
const [p, setP] = useState(0);
const parent = useRef<HTMLElement | Window | null>(null);
useEffect(() => {
const sp = scrollParent(root.current);
parent.current = sp;
const read = () => {
const el = sp instanceof Window ? document.documentElement : sp;
const max = el.scrollHeight - el.clientHeight;
setP(max > 0 ? el.scrollTop / max : 1);
};
read();
sp.addEventListener("scroll", read, { passive: true });
return () => sp.removeEventListener("scroll", read);
}, []);
const toTop = () => {
const smooth = !matchMedia("(prefers-reduced-motion: reduce)").matches;
parent.current?.scrollTo({ top: 0, behavior: smooth ? "smooth" : "auto" });
};
return (
<footer ref={root} className="gu-minifoot" data-theme={theme}>
<a href="#top" className="gu-minifoot__brand">
Ada Varga<span>.</span>
</a>
<nav aria-label="Footer">
<ul>
{LINKS.map((l) => (
<li key={l}>
<a href={`#${l.toLowerCase()}`} data-text={l}>
<span>{l}</span>
</a>
</li>
))}
</ul>
</nav>
<ul className="gu-minifoot__social" aria-label="Social">
{SOCIAL.map((s) => (
<li key={s}>
<a href={`#${s.toLowerCase()}`}>{s}</a>
</li>
))}
</ul>
<button
type="button"
className="gu-minifoot__top"
onClick={toTop}
style={{ "--p": p } as CSSProperties}
aria-label={`Back to top (${Math.round(p * 100)}% scrolled)`}
>
<svg viewBox="0 0 48 48" aria-hidden="true">
<circle cx="24" cy="24" r="22" className="gu-minifoot__track" />
<circle
cx="24"
cy="24"
r="22"
className="gu-minifoot__fill"
pathLength={1}
/>
<path d="M24 31V17m-6 6 6-6 6 6" />
</svg>
</button>
<p className="gu-minifoot__fine">© 2026 Ada Varga · Made in Budapest</p>
</footer>
);
}
Paste this into ChatGPT, Claude, Cursor, v0, Lovable or Bolt. It describes the layout, motion, colors and accessibility and includes the code, so the AI can rebuild it in any framework.
# Build this UI piece: Minimal footer with progress
You are a senior front-end engineer. Recreate the piece below in my project. If I don't say which framework I use, ask once, then build it in that framework (React, Vue, Svelte, Angular, Astro, plain HTML/CSS/JS or anything else). Keep the behavior, motion, colors, spacing and accessibility exactly as described. Keep the code clean and commented for beginners.
## What it is
A slim portfolio footer: name with an orange period, rolling nav links, muted social links, a back-to-top button whose ring fills with scroll progress, and a fine-print line.
## Layout and look
- One row on desktop (brand, nav, social, top button), fine print below; under 720px: brand + button, then nav, social and fine print stacked.
- Hairline top border, Cream (dark Ink) background.
- Nav links 44px tall, weight 700. Social links muted, 15px.
- Back to top: 52px circle; gray 3px track, orange 3px progress arc starting at 12 o'clock, an arrow in the middle; lifts 3px on hover.
## Behavior and motion
1. Find the nearest scrolling parent (or window) and set --p = scrollTop / (scrollHeight - clientHeight).
2. The arc uses pathLength=1, dasharray 1, dashoffset 1 - p.
3. Links roll on hover: the word slides up out of view while an orange copy slides up from below (450ms cubic-bezier(0.16, 1, 0.3, 1)).
4. Click scrolls the scroll parent to top smoothly.
## Touch
44px targets.
## Accessibility
- nav labelled "Footer"; the button label includes the scrolled percentage.
- prefers-reduced-motion: instant jump, no roll.
## Props
theme. Edit LINKS and SOCIAL.
## Reference implementation
The original is written in React with one plain CSS file. Dependencies: none (plain React and CSS). Translate it faithfully; do not add new libraries unless my framework needs them.
### MinimalFooter.tsx
```tsx
"use client";
import { useEffect, useRef, useState, type CSSProperties } from "react";
import "./minimal-footer.css";
const LINKS = ["Work", "About", "Journal", "Contact"];
const SOCIAL = ["Instagram", "LinkedIn", "Dribbble"];
/** Find the nearest scrolling parent (the page, or a scrolling box like a preview stage). */
function scrollParent(el: HTMLElement | null): HTMLElement | Window {
for (let p = el?.parentElement; p; p = p.parentElement) {
const o = getComputedStyle(p).overflowY;
if ((o === "auto" || o === "scroll") && p.scrollHeight > p.clientHeight)
return p;
}
return window;
}
/**
* MinimalFooter
* - Reads scroll progress of its scroll parent and draws it as a ring around the back-to-top button.
*/
export function MinimalFooter({
theme = "light",
}: {
theme?: "light" | "dark";
}) {
const root = useRef<HTMLElement>(null);
const [p, setP] = useState(0);
const parent = useRef<HTMLElement | Window | null>(null);
useEffect(() => {
const sp = scrollParent(root.current);
parent.current = sp;
const read = () => {
const el = sp instanceof Window ? document.documentElement : sp;
const max = el.scrollHeight - el.clientHeight;
setP(max > 0 ? el.scrollTop / max : 1);
};
read();
sp.addEventListener("scroll", read, { passive: true });
return () => sp.removeEventListener("scroll", read);
}, []);
const toTop = () => {
const smooth = !matchMedia("(prefers-reduced-motion: reduce)").matches;
parent.current?.scrollTo({ top: 0, behavior: smooth ? "smooth" : "auto" });
};
return (
<footer ref={root} className="gu-minifoot" data-theme={theme}>
<a href="#top" className="gu-minifoot__brand">
Ada Varga<span>.</span>
</a>
<nav aria-label="Footer">
<ul>
{LINKS.map((l) => (
<li key={l}>
<a href={`#${l.toLowerCase()}`} data-text={l}>
<span>{l}</span>
</a>
</li>
))}
</ul>
</nav>
<ul className="gu-minifoot__social" aria-label="Social">
{SOCIAL.map((s) => (
<li key={s}>
<a href={`#${s.toLowerCase()}`}>{s}</a>
</li>
))}
</ul>
<button
type="button"
className="gu-minifoot__top"
onClick={toTop}
style={{ "--p": p } as CSSProperties}
aria-label={`Back to top (${Math.round(p * 100)}% scrolled)`}
>
<svg viewBox="0 0 48 48" aria-hidden="true">
<circle cx="24" cy="24" r="22" className="gu-minifoot__track" />
<circle
cx="24"
cy="24"
r="22"
className="gu-minifoot__fill"
pathLength={1}
/>
<path d="M24 31V17m-6 6 6-6 6 6" />
</svg>
</button>
<p className="gu-minifoot__fine">© 2026 Ada Varga · Made in Budapest</p>
</footer>
);
}
```
### minimal-footer.css
```css
/* MinimalFooter: change these colors to match your brand. */
.gu-minifoot {
--bg: #f3eee3;
--text: #0e0e10;
--muted: #57534b;
--line: rgb(14 14 16 / 0.14);
--accent: #ff5a1f;
--focus: #2b35ff;
--ease: cubic-bezier(0.16, 1, 0.3, 1);
container-type: inline-size;
display: grid;
grid-template-columns: auto 1fr auto auto;
grid-template-areas: "brand nav social top" "fine fine fine fine";
align-items: center;
gap: 16px 28px;
padding: 28px clamp(18px, 4%, 48px);
border-top: 1px solid var(--line);
background: var(--bg);
color: var(--text);
font-family: system-ui, sans-serif;
}
.gu-minifoot[data-theme="dark"] {
--bg: #0e0e10;
--text: #f3eee3;
--muted: #aea89c;
--line: rgb(243 238 227 / 0.14);
--focus: #d7ff3a;
}
.gu-minifoot a {
color: inherit;
text-decoration: none;
}
.gu-minifoot a:focus-visible,
.gu-minifoot button:focus-visible {
outline: 3px solid var(--focus);
outline-offset: 3px;
border-radius: 6px;
}
.gu-minifoot__brand {
grid-area: brand;
font-size: 1.4rem;
font-weight: 900;
letter-spacing: -0.04em;
}
.gu-minifoot__brand span {
color: var(--accent);
}
.gu-minifoot nav {
grid-area: nav;
}
.gu-minifoot ul {
display: flex;
flex-wrap: wrap;
gap: 4px 20px;
margin: 0;
padding: 0;
list-style: none;
}
/* Rolling link: the word slides up and a copy slides in from below */
.gu-minifoot nav a {
position: relative;
display: inline-grid;
height: 44px;
overflow: hidden;
font-weight: 700;
}
/* Both copies are as tall as the link, so each slide moves the full 44px and nothing peeks out */
.gu-minifoot nav a span,
.gu-minifoot nav a::after {
display: flex;
align-items: center;
transition: transform 0.45s var(--ease);
}
.gu-minifoot nav a::after {
content: attr(data-text);
position: absolute;
inset: 0;
color: var(--accent);
transform: translateY(100%);
}
.gu-minifoot nav a:hover span {
transform: translateY(-100%);
}
.gu-minifoot nav a:hover::after {
transform: none;
}
.gu-minifoot__social {
grid-area: social;
}
.gu-minifoot__social a {
display: inline-flex;
align-items: center;
min-height: 44px;
color: var(--muted);
font-size: 0.9rem;
font-weight: 600;
}
.gu-minifoot__social a:hover {
color: var(--text);
}
.gu-minifoot__top {
grid-area: top;
width: 52px;
height: 52px;
padding: 0;
border: 0;
border-radius: 50%;
background: none;
color: inherit;
cursor: pointer;
transition: transform 0.3s var(--ease);
}
.gu-minifoot__top:hover {
transform: translateY(-3px);
}
.gu-minifoot__top svg {
width: 100%;
fill: none;
stroke-linecap: round;
stroke-linejoin: round;
}
.gu-minifoot__track {
stroke: var(--line);
stroke-width: 3;
}
.gu-minifoot__fill {
stroke: var(--accent);
stroke-width: 3;
stroke-dasharray: 1;
stroke-dashoffset: calc(1 - var(--p));
rotate: -90deg;
transform-origin: center;
}
.gu-minifoot__top path {
stroke: currentColor;
stroke-width: 2.4;
}
.gu-minifoot__fine {
grid-area: fine;
margin: 0;
color: var(--muted);
font-size: 0.8rem;
}
@container (max-width: 720px) {
/* The root is the container, so it cannot query itself: its children span the full row instead */
.gu-minifoot > *,
.gu-minifoot > nav {
grid-area: auto / 1 / auto / -1;
}
.gu-minifoot > .gu-minifoot__brand {
grid-area: 1 / 1 / 2 / 3;
}
.gu-minifoot > .gu-minifoot__top {
grid-area: 1 / 3 / 2 / 5;
justify-self: end;
}
}
@media (prefers-reduced-motion: reduce) {
.gu-minifoot nav a span,
.gu-minifoot nav a::after,
.gu-minifoot__top {
transition: none;
}
}
```
You might also want
Next piece: Modal dialogBig footer with signup
Templates, intermediate
Changelog timeline
Templates, intermediate
Feature tabs with autoplay
Templates, intermediate