Staaarter

Year-Grouped Accordion Changelog

A changelog grouped by year: each year is a collapsible accordion panel showing a release-count summary (e.g. "2026 (3 releases)") that expands to reveal that year's individual releases, each with its version, date, and tone-coded change list.

By Staaarter Team
Changelog
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/year-grouped-accordion-changelog.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/changelog/changelog14.tsx instead.

Usage

The file also exports changelog14Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Changelog14, changelog14Demo } from "@/components/blocks/changelog/changelog14";

export default function Page() {
  return <Changelog14 {...changelog14Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Changelog"Section heading above the accordion.
descriptionstringundefinedShort intro paragraph under the heading.
groupsYearGroup[]noneYear groups rendered top to bottom, most recent year first.
classNamestringnoneExtra classes for the outer section element.

Types

type ChangeType = "added" | "changed" | "fixed" | "removed";

interface Change {
  type: ChangeType;
  label: string;
  text: string;
}

interface Release {
  version: string;
  date: string;
  heading?: string;
  description?: string;
  changes: Change[];
}

interface YearGroup {
  year: string;
  releases: Release[];
}

Behavior notes

  • This is a "use client" component with real expand/collapse state (`useState<string | null>`), one year open at a time; opening a year collapses whichever other year was previously open.
  • Defaults to the first entry in `groups` being open (intended to be the most recent year, assuming callers pass groups newest-first) rather than deriving the initial open state in an effect.
  • Each year's trigger is a real `<button>` with `aria-expanded` reflecting the real open state and `aria-controls` pointing at the matching panel `id`; the chevron icon rotates purely via a CSS class driven by that same state.
  • The change tags follow this category's tone convention: added uses Badge variant default, changed uses secondary, fixed uses outline, removed uses destructive.
  • The demo props live in a sibling `changelog14.demo.tsx` file (not the "use client" component file itself), per this repo's Blocks client-component convention.