shadcn.io is not affiliated with official shadcn/ui
Package Changelog Block for React
One package's changelog behind a version select: its semver bump, release day, weekly downloads that count on to each version's figure, a Migration guide link, the install command with a Copy button and the changes in an accordion of groups.
Installation
Overview
A package changelog for React with Base UI, written for Nibpack, a fictional package registry, and one of its packages, stitchdown. It is a split. At the start: the headline, a Version select (v4.2.0, v4.1.0, v4.0.0-rc.1) and the facts of the chosen version: its semver bump as a badge with an icon and a word (a prerelease says so), the day it shipped, its first-week downloads (a number that counts on to each version's figure), a Migration guide link and the install command in a focusable code region with a Copy button. Past a divider, what changed in an accordion of groups (Breaking, Features, Fixes, Dependencies) with a count each; the first group is open, and a polite line says how many changes there are. Choosing a version rebuilds the accordion, and an unseen copy of every version's groups holds the height. On a phone the select comes right after the title and the groups follow the facts. It's built from Select, Accordion, Copy Button, Counting Number, Badge and Guides, with CSS transitions for the entrance and your theme's tokens for every colour. For a library's release page or a registry's package view. The package, the nibpack command and the numbers are example data.
FAQ
How do I change the versions and their changes?
Edit VERSIONS at the top of the file. A version has an id, its tag (the label in the select), a bump (Minor or Major), a prerelease flag, an ISO date, downloads and its groups: a kind (Breaking, Features, Fixes, Dependencies) and a list of one-line changes. A kind with no changes is simply left out, and the first group in the list is the one that opens, so put Breaking first when a version has any. Counts and the polite summary are computed from the lists.
How does the version select work?
It is the catalog Select, so it opens with Enter, Space or the arrow keys, type-ahead picks an item, and Escape closes it. Choosing a version swaps the facts and rebuilds the accordion with its first group open. The block keeps its height because an unseen copy of every version's groups sits in the same grid cell.
What does the downloads figure do?
It is Counting Number: choosing another version counts on from the figure showing to the new one, instead of jumping. Screen readers read the value, never the count, and with reduced motion the new value appears at once. The number sits in a fixed width so the facts around it don't shift.
How does the accordion work with a keyboard?
Each group's heading is a button: Enter or Space opens and closes it, and a count beside the name says how many changes are inside. Tab moves between the group headings; the arrow keys don't.
What does the Copy button do?
It copies the install command for the chosen version, swaps its icon for a check and tells screen readers "Copied the install command for v4.2.0" through a polite line. If the clipboard refuses it says it couldn't copy. The command is plain text in a focusable region, so it can be selected by hand and scrolls on a phone.
What moves, and what happens with reduced motion?
The header, the facts and the groups fade up once on load, with CSS transitions, and the downloads figure counts when the version changes. With reduced motion the entrances are off, the figure changes at once and the accordion opens without its slide.
Related
- Pro
SDK Versions Changelog
APIs and integrationsClient libraries in one tabbed window: a tab per language with its latest version, then that version large, its day, a support state as a shape and a word, the install command in a code region with a Copy button, and a table of the last three versions.
- Pro
Dependency Updates Changelog
Packages and versionsA table of eight dependency updates in two groups, Production and Dev: package, old and new version, the kind of bump and a three-pip risk, with sortable heads that reorder the rows inside each group.
- Pro
Monorepo Packages Changelog
Packages and versionsOne release as a workspace tree: the facts at the start, and past a divider a tree of packages with each version bump, its kind as an icon and a word, and the packages that were bumped only because something they depend on changed.
- $Pro
Breaking Changes Changelog
APIs and integrationsA framed table of four breaking calls: the old call in a del row, the new in an ins row, who it affects and the day to migrate by, with a codemod command in a terminal strip and a Copy button.
- Pro
Migration Guide Changelog
APIs and integrationsA split: a deadline tag and a running progress count at the start, four migration steps at the end, each with a Done checkbox and a copyable config snippet in a collapsible.
- Pro
Semantic Versioning Changelog
Packages and versionsThe anatomy of v3.8.2 split into Major, Minor and Patch with leaders to what each means, a toggle that previews the next version with a rolling number, and the latest release of each kind.