time-index
Interactive changelog/timeline with relative dates, version filtering, sort toggle, and recently updated pages feed.
Overview
The <time-index> component enhances a static changelog or timeline with relative dates, version filtering, sort toggle, and a recently updated pages feed. Without JavaScript, the changelog renders as a readable ordered list.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
group |
string | "version" |
Grouping mode: "month" or "version" |
view |
string | "date" |
View mode: "date" or "version" |
versions |
boolean | — | Enable version filter dropdown |
updates-src |
string | — | URL for recently updated pages JSON data. When set, a recently updated pages feed is shown. |
Version Filtering
Add versions to inject a dropdown that lets users filter the changelog to a specific version.
Grouping by Month
Set group="month" to group entries by calendar month instead of version number. Useful for project timelines or blogs.
Recently Updated Pages
Set updates-src to display a feed of recently updated pages alongside the changelog, loaded from a JSON endpoint.
Page List Markup
The page list can also be provided as static markup:
CSS Classes
| Class / Element | Purpose |
|---|---|
.changelog-entries |
Ordered list wrapping all changelog items |
.version-header |
Heading for each version or date group |
.version-tag |
Version number badge |
mark.new |
New feature badge |
mark.change |
Change or update badge |
mark.fix |
Bug fix badge |
mark.remove |
Removal or deprecation badge |
.page-version-list |
List of recently updated pages |
Behavior
- Relative dates:
<time>elements are enhanced with relative labels (e.g., "2 weeks ago") via tooltip or inline text. - Sort toggle: A button is injected to toggle between newest-first and oldest-first ordering.
- Version filter: When enabled, a dropdown lists all versions for quick filtering.
- Progressive enhancement: Without JavaScript, the static ordered list renders in document order.
Accessibility
- Uses semantic
<ol>,<time>, and<mark>elements - Sort toggle button uses
aria-pressedto indicate sort direction - Version filter dropdown is labelled for screen readers
- Change type badges use
<mark>for semantic highlighting - Keyboard accessible — tab through controls and links
- Without JavaScript, content remains fully readable
Related
<change-set>— Inline change tracking for document revisions<page-info>— Page metadata display<site-index>— Keyword index with search