Changelog timeline
Release notes people enjoy reading: a timeline that draws itself as you scroll, filter chips with a sliding pill, releases that open to their full list and tilting covers for big launches.
"use client";
import { useEffect, useRef, useState, type CSSProperties } from "react";
import "./changelog.css";
export type Kind = "new" | "improved" | "fixed";
export type Release = {
version: string;
date: string;
title: string;
summary: string;
changes: { kind: Kind; text: string }[];
/** Hue for the small cover drawn for big releases. */
hue?: number;
};
const KINDS: { id: Kind | "all"; label: string }[] = [
{ id: "all", label: "Everything" },
{ id: "new", label: "New" },
{ id: "improved", label: "Improved" },
{ id: "fixed", label: "Fixed" },
];
/**
* Changelog: release notes people actually enjoy reading.
* - Filter chips with a sliding pill; releases with nothing left after filtering fold away.
* - Each release opens to show its full list; the timeline rail draws itself as you scroll.
* - Big releases get a small cover drawn in code that tilts toward the cursor.
*/
export function Changelog({
title = "What's new",
releases,
theme = "dark",
}: {
title?: string;
releases: Release[];
theme?: "light" | "dark";
}) {
const [filter, setFilter] = useState<Kind | "all">("all");
const [open, setOpen] = useState<Set<string>>(
new Set([releases[0]?.version]),
);
const list = useRef<HTMLOListElement>(null);
// Each release reveals itself (and lights its dot) the first time it scrolls into view.
useEffect(() => {
const io = new IntersectionObserver(
(entries) =>
entries.forEach((e) => {
if (e.isIntersecting) (e.target as HTMLElement).dataset.seen = "true";
}),
{ rootMargin: "0px 0px -15% 0px" },
);
list.current
?.querySelectorAll("li.gu-log__item")
.forEach((li) => io.observe(li));
return () => io.disconnect();
}, [releases]);
const fi = KINDS.findIndex((k) => k.id === filter);
return (
<section
className="gu-log"
data-theme={theme}
aria-labelledby="gu-log-title"
>
<header className="gu-log__head">
<h2 id="gu-log-title">{title}</h2>
<div
className="gu-log__chips"
role="group"
aria-label="Show"
style={{ "--i": fi } as CSSProperties}
>
<span className="gu-log__pill" aria-hidden="true" />
{KINDS.map((k) => (
<button
key={k.id}
type="button"
aria-pressed={filter === k.id}
onClick={() => setFilter(k.id)}
>
{k.label}
</button>
))}
</div>
</header>
<ol className="gu-log__list" ref={list}>
{releases.map((r) => {
const shown = r.changes.filter(
(c) => filter === "all" || c.kind === filter,
);
const isOpen = open.has(r.version);
const id = `gu-log-${r.version.replace(/\W/g, "")}`;
return (
<li
key={r.version}
className="gu-log__item"
data-empty={shown.length === 0}
>
<div className="gu-log__meta">
<span className="gu-log__ver">v{r.version}</span>
<time>{r.date}</time>
</div>
<span className="gu-log__node" aria-hidden="true" />
<article className="gu-log__card">
{r.hue !== undefined && (
<div
className="gu-log__cover"
style={{ "--h": r.hue } as CSSProperties}
aria-hidden="true"
onPointerMove={(e) => {
const b = e.currentTarget.getBoundingClientRect();
e.currentTarget.style.setProperty(
"--rx",
`${((e.clientY - b.top) / b.height - 0.5) * -10}deg`,
);
e.currentTarget.style.setProperty(
"--ry",
`${((e.clientX - b.left) / b.width - 0.5) * 14}deg`,
);
}}
onPointerLeave={(e) => {
e.currentTarget.style.setProperty("--rx", "0deg");
e.currentTarget.style.setProperty("--ry", "0deg");
}}
>
<span className="gu-log__cover-ring" />
<span className="gu-log__cover-ring" data-r="2" />
<strong>{r.version}</strong>
</div>
)}
<h3>{r.title}</h3>
<p className="gu-log__summary">{r.summary}</p>
<button
type="button"
className="gu-log__toggle"
aria-expanded={isOpen}
aria-controls={id}
onClick={() =>
setOpen((s) => {
const n = new Set(s);
if (n.has(r.version)) n.delete(r.version);
else n.add(r.version);
return n;
})
}
>
{isOpen
? "Hide changes"
: `See ${shown.length} change${shown.length === 1 ? "" : "s"}`}
<svg viewBox="0 0 24 24" aria-hidden="true">
<path d="m6 9 6 6 6-6" />
</svg>
</button>
<div className="gu-log__more" id={id} data-open={isOpen}>
<ul>
{shown.map((c, j) => (
<li
key={c.text}
data-kind={c.kind}
style={{ "--j": j } as CSSProperties}
>
<span className="gu-log__tag">{c.kind}</span>
{c.text}
</li>
))}
</ul>
</div>
</article>
</li>
);
})}
</ol>
</section>
);
}
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: Changelog timeline
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 changelog section for a product: a vertical timeline of releases. Filter chips (Everything / New / Improved / Fixed) with a sliding orange pill, a rail and dots that draw and light up as each release scrolls into view, cards that open to show their full change list, and a code-drawn tilting cover for big releases.
## Layout and look
- Dark: #0e0e10 page, #18181d cards, cream #f3eee3 text, hairlines at 12% cream; light swaps to cream page and #fffdf8 cards. Accent #ff5a1f.
- Header row (max 960px): headline clamp(40px, 6vw, 72px) weight 900; on the right a pill group of four 40px chips inside a 1px outline, with an orange pill under the selected chip.
- Timeline grid per release: 140px meta column (version 18px bold, date 13px at 60%, right aligned), a 28px node column (16px dot), then the card (radius 22px, padding 22px). The rail runs through the node column.
- Card: optional 150px cover (hue gradient with a lighter radial spot, two slowly rotating rings, a huge version number in overlay blend), title 22px weight 800, 16px summary, an orange "See 4 changes" toggle with a chevron.
- Change rows: hairline separated, a coloured tag (New = lime #d7ff3a, Improved = ultramarine #2b35ff with white text, Fixed = grey) then the text.
## Behavior and motion
1. Each release is watched by an IntersectionObserver (bottom margin −15%). When seen: its piece of orange rail grows down (scaleY 0 → 1, 1.1s), the dot turns orange with a halo, and the card rises 24px and fades in.
2. Chips: the pill slides with translate(index × 100%) and a spring. Changes not matching the filter disappear; a release with none left dims to 30% and hides its toggle.
3. Toggle: grid-template-rows 0fr → 1fr (550ms) and rows slide in from the left with a 50ms stagger; the chevron flips with a spring.
4. Cover: tilts toward the pointer (perspective 700px, up to ±5° X and ±7° Y), springs flat on leave.
## Phones (under 640px)
Two columns: rail and dot on the left, version and date in a row above each card.
## Accessibility
- Section labelled by its h2, an ordered list of releases, articles with h3. Chips are toggle buttons with aria-pressed. Toggles use aria-expanded and aria-controls. Covers are aria-hidden.
- prefers-reduced-motion: everything appears and opens instantly, covers do not tilt.
## Props
title, releases ({ version, date, title, summary, changes: { kind: "new" | "improved" | "fixed", text }[], hue? }[]), theme.
## 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.
### Changelog.tsx
```tsx
"use client";
import { useEffect, useRef, useState, type CSSProperties } from "react";
import "./changelog.css";
export type Kind = "new" | "improved" | "fixed";
export type Release = {
version: string;
date: string;
title: string;
summary: string;
changes: { kind: Kind; text: string }[];
/** Hue for the small cover drawn for big releases. */
hue?: number;
};
const KINDS: { id: Kind | "all"; label: string }[] = [
{ id: "all", label: "Everything" },
{ id: "new", label: "New" },
{ id: "improved", label: "Improved" },
{ id: "fixed", label: "Fixed" },
];
/**
* Changelog: release notes people actually enjoy reading.
* - Filter chips with a sliding pill; releases with nothing left after filtering fold away.
* - Each release opens to show its full list; the timeline rail draws itself as you scroll.
* - Big releases get a small cover drawn in code that tilts toward the cursor.
*/
export function Changelog({
title = "What's new",
releases,
theme = "dark",
}: {
title?: string;
releases: Release[];
theme?: "light" | "dark";
}) {
const [filter, setFilter] = useState<Kind | "all">("all");
const [open, setOpen] = useState<Set<string>>(
new Set([releases[0]?.version]),
);
const list = useRef<HTMLOListElement>(null);
// Each release reveals itself (and lights its dot) the first time it scrolls into view.
useEffect(() => {
const io = new IntersectionObserver(
(entries) =>
entries.forEach((e) => {
if (e.isIntersecting) (e.target as HTMLElement).dataset.seen = "true";
}),
{ rootMargin: "0px 0px -15% 0px" },
);
list.current
?.querySelectorAll("li.gu-log__item")
.forEach((li) => io.observe(li));
return () => io.disconnect();
}, [releases]);
const fi = KINDS.findIndex((k) => k.id === filter);
return (
<section
className="gu-log"
data-theme={theme}
aria-labelledby="gu-log-title"
>
<header className="gu-log__head">
<h2 id="gu-log-title">{title}</h2>
<div
className="gu-log__chips"
role="group"
aria-label="Show"
style={{ "--i": fi } as CSSProperties}
>
<span className="gu-log__pill" aria-hidden="true" />
{KINDS.map((k) => (
<button
key={k.id}
type="button"
aria-pressed={filter === k.id}
onClick={() => setFilter(k.id)}
>
{k.label}
</button>
))}
</div>
</header>
<ol className="gu-log__list" ref={list}>
{releases.map((r) => {
const shown = r.changes.filter(
(c) => filter === "all" || c.kind === filter,
);
const isOpen = open.has(r.version);
const id = `gu-log-${r.version.replace(/\W/g, "")}`;
return (
<li
key={r.version}
className="gu-log__item"
data-empty={shown.length === 0}
>
<div className="gu-log__meta">
<span className="gu-log__ver">v{r.version}</span>
<time>{r.date}</time>
</div>
<span className="gu-log__node" aria-hidden="true" />
<article className="gu-log__card">
{r.hue !== undefined && (
<div
className="gu-log__cover"
style={{ "--h": r.hue } as CSSProperties}
aria-hidden="true"
onPointerMove={(e) => {
const b = e.currentTarget.getBoundingClientRect();
e.currentTarget.style.setProperty(
"--rx",
`${((e.clientY - b.top) / b.height - 0.5) * -10}deg`,
);
e.currentTarget.style.setProperty(
"--ry",
`${((e.clientX - b.left) / b.width - 0.5) * 14}deg`,
);
}}
onPointerLeave={(e) => {
e.currentTarget.style.setProperty("--rx", "0deg");
e.currentTarget.style.setProperty("--ry", "0deg");
}}
>
<span className="gu-log__cover-ring" />
<span className="gu-log__cover-ring" data-r="2" />
<strong>{r.version}</strong>
</div>
)}
<h3>{r.title}</h3>
<p className="gu-log__summary">{r.summary}</p>
<button
type="button"
className="gu-log__toggle"
aria-expanded={isOpen}
aria-controls={id}
onClick={() =>
setOpen((s) => {
const n = new Set(s);
if (n.has(r.version)) n.delete(r.version);
else n.add(r.version);
return n;
})
}
>
{isOpen
? "Hide changes"
: `See ${shown.length} change${shown.length === 1 ? "" : "s"}`}
<svg viewBox="0 0 24 24" aria-hidden="true">
<path d="m6 9 6 6 6-6" />
</svg>
</button>
<div className="gu-log__more" id={id} data-open={isOpen}>
<ul>
{shown.map((c, j) => (
<li
key={c.text}
data-kind={c.kind}
style={{ "--j": j } as CSSProperties}
>
<span className="gu-log__tag">{c.kind}</span>
{c.text}
</li>
))}
</ul>
</div>
</article>
</li>
);
})}
</ol>
</section>
);
}
```
### changelog.css
```css
.gu-log {
--bg: #0e0e10;
--fg: #f3eee3;
--card: #18181d;
--line: rgb(243 238 227 / 0.12);
--accent: #ff5a1f;
--ease: cubic-bezier(0.16, 1, 0.3, 1);
--spring: cubic-bezier(0.34, 1.56, 0.64, 1);
background: var(--bg);
color: var(--fg);
padding: clamp(48px, 8vw, 104px) clamp(18px, 5vw, 56px);
font-family: ui-sans-serif, system-ui, sans-serif;
}
.gu-log[data-theme="light"] {
--bg: #f3eee3;
--fg: #0e0e10;
--card: #fffdf8;
--line: rgb(14 14 16 / 0.12);
}
.gu-log__head {
display: flex;
flex-wrap: wrap;
align-items: end;
justify-content: space-between;
gap: 20px;
max-width: 960px;
margin: 0 auto 48px;
}
.gu-log__head h2 {
margin: 0;
font-size: clamp(40px, 6vw, 72px);
font-weight: 900;
letter-spacing: -0.045em;
line-height: 0.95;
}
.gu-log__chips {
position: relative;
display: grid;
grid-template-columns: repeat(4, auto);
padding: 4px;
border-radius: 999px;
box-shadow: inset 0 0 0 1px var(--line);
}
.gu-log__chips button {
position: relative;
z-index: 1;
min-height: 40px;
padding: 0 16px;
border: 0;
border-radius: 999px;
background: none;
color: inherit;
font-family: inherit;
font-size: 14px;
font-weight: 700;
cursor: pointer;
transition: color 0.3s;
}
.gu-log__chips button[aria-pressed="true"] {
color: #0e0e10;
}
.gu-log__chips button:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
/* The pill measures nothing: each chip has a fixed share, so it slides with pure CSS. */
.gu-log__pill {
position: absolute;
top: 4px;
bottom: 4px;
left: 4px;
width: calc((100% - 8px) / 4);
border-radius: 999px;
background: var(--accent);
translate: calc(var(--i) * 100%) 0;
transition: translate 0.55s var(--spring);
}
.gu-log__chips {
grid-template-columns: repeat(4, 1fr);
}
.gu-log__list {
position: relative;
list-style: none;
max-width: 960px;
margin: 0 auto;
padding: 0;
}
.gu-log__item {
position: relative;
display: grid;
grid-template-columns: 140px 28px 1fr;
gap: 0 18px;
padding-bottom: 36px;
transition:
opacity 0.5s,
padding 0.5s var(--ease);
}
/* Rail: each item draws its own piece of the line when it comes into view. */
.gu-log__item::before {
content: "";
position: absolute;
left: calc(140px + 18px + 13px);
top: 12px;
bottom: -12px;
width: 2px;
background: var(--accent);
transform-origin: top;
scale: 1 0;
transition: scale 1.1s var(--ease);
}
.gu-log__item::after {
content: "";
position: absolute;
left: calc(140px + 18px + 13px);
top: 12px;
bottom: -12px;
width: 2px;
background: var(--line);
z-index: -1;
}
.gu-log__item:last-child::before,
.gu-log__item:last-child::after {
bottom: 0;
}
.gu-log__item[data-seen="true"]::before {
scale: 1 1;
}
.gu-log__meta {
padding-top: 4px;
text-align: right;
}
.gu-log__ver {
display: block;
font-size: 18px;
font-weight: 800;
letter-spacing: -0.02em;
}
.gu-log__meta time {
font-size: 13px;
opacity: 0.6;
}
.gu-log__node {
position: relative;
z-index: 1;
width: 16px;
height: 16px;
margin: 8px auto 0;
border-radius: 50%;
background: var(--bg);
box-shadow: inset 0 0 0 2px var(--line);
transition:
background-color 0.4s,
box-shadow 0.4s,
scale 0.6s var(--spring);
}
.gu-log__item[data-seen="true"] .gu-log__node {
background: var(--accent);
box-shadow: 0 0 0 6px rgb(255 90 31 / 0.18);
}
.gu-log__card {
padding: 22px;
border-radius: 22px;
background: var(--card);
box-shadow: inset 0 0 0 1px var(--line);
opacity: 0;
translate: 0 24px;
transition:
opacity 0.7s var(--ease),
translate 0.8s var(--ease);
}
.gu-log__item[data-seen="true"] .gu-log__card {
opacity: 1;
translate: 0 0;
}
.gu-log__item[data-empty="true"] {
opacity: 0.3;
}
.gu-log__item[data-empty="true"] .gu-log__toggle {
display: none;
}
.gu-log__card h3 {
margin: 0;
font-size: 22px;
font-weight: 800;
letter-spacing: -0.02em;
}
.gu-log__summary {
margin: 8px 0 0;
font-size: 16px;
line-height: 1.55;
opacity: 0.78;
}
.gu-log__cover {
--rx: 0deg;
--ry: 0deg;
position: relative;
display: grid;
place-items: center;
height: 150px;
margin-bottom: 18px;
border-radius: 14px;
overflow: hidden;
background:
radial-gradient(
circle at 30% 30%,
hsl(calc(var(--h) + 30) 100% 70%),
transparent 55%
),
linear-gradient(
135deg,
hsl(var(--h) 90% 55%),
hsl(calc(var(--h) + 70) 80% 35%)
);
transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry));
transition: transform 0.5s var(--ease);
}
.gu-log__cover strong {
position: relative;
font-size: 64px;
font-weight: 900;
letter-spacing: -0.06em;
color: #fff;
mix-blend-mode: overlay;
}
.gu-log__cover-ring {
position: absolute;
width: 220px;
aspect-ratio: 1;
border-radius: 50%;
border: 1.5px solid rgb(255 255 255 / 0.4);
animation: gu-log-ring 6s linear infinite;
}
.gu-log__cover-ring[data-r="2"] {
width: 140px;
border-style: dashed;
animation-direction: reverse;
animation-duration: 9s;
}
@keyframes gu-log-ring {
to {
rotate: 360deg;
}
}
.gu-log__toggle {
display: inline-flex;
align-items: center;
gap: 6px;
min-height: 40px;
margin-top: 12px;
padding: 0;
border: 0;
background: none;
color: var(--accent);
font-family: inherit;
font-size: 14px;
font-weight: 700;
cursor: pointer;
}
.gu-log__toggle:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 4px;
border-radius: 6px;
}
.gu-log__toggle svg {
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 2.4;
stroke-linecap: round;
transition: rotate 0.5s var(--spring);
}
.gu-log__toggle[aria-expanded="true"] svg {
rotate: 180deg;
}
.gu-log__more {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 0.55s var(--ease);
}
.gu-log__more[data-open="true"] {
grid-template-rows: 1fr;
}
.gu-log__more ul {
overflow: hidden;
list-style: none;
margin: 0;
padding: 0;
}
.gu-log__more li {
display: flex;
align-items: baseline;
gap: 12px;
padding: 10px 0;
border-top: 1px solid var(--line);
font-size: 15px;
line-height: 1.5;
}
.gu-log__more li:first-child {
margin-top: 10px;
}
.gu-log__more[data-open="true"] li {
animation: gu-log-li 0.5s calc(var(--j) * 50ms) var(--ease) backwards;
}
@keyframes gu-log-li {
from {
opacity: 0;
translate: -10px 0;
}
}
.gu-log__tag {
flex: none;
min-width: 76px;
padding: 3px 8px;
border-radius: 6px;
font-size: 11px;
font-weight: 800;
text-align: center;
text-transform: capitalize;
}
[data-kind="new"] .gu-log__tag {
background: #d7ff3a;
color: #0e0e10;
}
[data-kind="improved"] .gu-log__tag {
background: #2b35ff;
color: #fff;
}
[data-kind="fixed"] .gu-log__tag {
background: var(--line);
color: inherit;
}
@media (max-width: 640px) {
.gu-log__item {
grid-template-columns: 22px 1fr;
}
.gu-log__meta {
grid-column: 2;
text-align: left;
display: flex;
gap: 10px;
align-items: baseline;
margin-bottom: 8px;
}
.gu-log__node {
grid-column: 1;
grid-row: 1;
margin: 6px 0 0;
}
.gu-log__card {
grid-column: 2;
}
.gu-log__item::before,
.gu-log__item::after {
left: 7px;
}
}
@media (prefers-reduced-motion: reduce) {
.gu-log *,
.gu-log *::before,
.gu-log *::after {
animation-duration: 0.01ms !important;
animation-delay: 0ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
.gu-log__cover {
transform: none;
}
}
```
You might also want
Next piece: Confetti send buttonHow it works, sticky scenes
Templates, intermediate
Integrations orbit
Templates, intermediate
Scroll-drawn timeline
Templates, intermediate