Staaarter

Accordion Release Changelog

A changelog where every individual release is its own collapsible accordion item: collapsed, a row shows just the version, date, and a one-line summary; expanded, it reveals the full description 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/accordion-release-changelog.json

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

Usage

The file also exports changelog13Demo, 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 { Changelog13, changelog13Demo } from "@/components/blocks/changelog/changelog13";

export default function Page() {
  return <Changelog13 {...changelog13Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Release notes"Section heading above the accordion.
descriptionstringundefinedShort intro paragraph under the heading.
releasesRelease[]noneReleases rendered top to bottom, most recent 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 {
  id: string;
  version: string;
  date: string;
  summary: string;
  description: string;
  changes: Change[];
}

Behavior notes

  • This is a "use client" component with real expand/collapse state (`useState<string | null>`), single-open-at-a-time: opening a release collapses whichever other release was previously open.
  • Defaults to the first release in the array being open rather than deriving the initial open state in an effect.
  • Each release's trigger is a real `<button>` with `aria-expanded` reflecting the real open state and `aria-controls` pointing at the matching panel `id`; the one-line `summary` only renders while collapsed, replaced by the full `description` and change list once expanded.
  • 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 `changelog13.demo.tsx` file (not the "use client" component file itself), per this repo's Blocks client-component convention.