0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
WAI-ARIA Feed timeline of user actions with relative timestamps. Optional date grouping, optional infinite-scroll sentinel, optional avatar / icon left-rail.
Overview
<activity-feed> renders a vertical timeline of user actions ("Ada commented on issue #482, 2 hours ago"). Read-only and immutable per entry. Authors render entries as <article data-activity> children, timestamped with data-time or an authored <time datetime>; the component decorates each with a relative-time badge, optional date headings, and optional avatar / icon left-rail.
When to use which primitive
Use this
When
<activity-feed>
One-way, immutable timeline of "actor verb object" actions with relative timestamps.
Real-time chat with sender grouping (different interaction model).
Author surface
Each entry is a direct <article data-activity> child timestamped with an ISO-8601 data-timeattribute. Inside the entry, you author the content however you like — the component does not dictate the verb vocabulary or object shape.
Plain feed
12345678
<activity-feedaria-label="Recent activity"><articledata-activitydata-time="2026-05-14T10:00:00Z"><ahref="/users/ada">Ada</a> commented on <ahref="/issues/482">issue #482</a></article><articledata-activitydata-time="2026-05-14T09:30:00Z"><ahref="/users/bob">Bob</a> opened <ahref="/issues/485">issue #485</a></article></activity-feed>
Times without JavaScript
Instead of data-time, an entry can carry its timestamp as a <time datetime>direct child. Without JavaScript the authored text (for example May 13, 2026) is what readers see; once the component upgrades, that same element moves to the time column, its text becomes relative (2 days ago), and its title shows the absolute time. If both are present, data-time wins. Only a direct child counts, so a <time> nested inside the sentence is left alone.
Set data-group="day" or data-group="week" to insert date headings between entries. "Today" and "Yesterday" are localized; older days use the locale's date format.
Add data-activity-avatar="URL" for a circular avatar via <user-avatar>, or data-activity-icon="name" for a Lucide icon via <icon-wc>. Mutually exclusive — avatar wins if both are set.
With avatars
1234567
<articledata-activitydata-time="..."data-activity-avatar="/users/ada.jpg"><ahref="/users/ada">Ada</a> commented on <ahref="/issues/482">issue #482</a></article><articledata-activitydata-time="..."data-activity-icon="git-merge"><ahref="/users/bob">Bob</a> merged <ahref="/pull/120">PR #120</a></article>
Infinite scroll
Set data-infinite to add an IntersectionObserver sentinel at the end of the feed. When the sentinel comes into view, activity-feed:load-more fires and the feed sets aria-busy="true". Only one request is outstanding at a time: no further load-more fires until the busy state ends.
The busy state ends when any of these happens:
you call event.detail.done() (do this in a finally so a failed request does not leave the feed busy);
new entries arrive (via addEntry or direct DOM insertion);
you remove data-infinite, which also ends the feed.
When the busy state ends, the sentinel re-arms. If it is still in view because the batch did not fill the viewport, another load-more fires. When there is nothing left to load, remove data-infinite: the sentinel goes away and aria-setsize switches from -1 (unknown) to the real count.
When the feed has zero entries, the component renders data-empty-text (default No recent activity). The empty state is auto-removed when the first entry is added. While empty, the host's role is group rather than feed, because a feed may only contain articles.
Empty placeholder
1
<activity-feeddata-empty-text="No activity yet — check back later."></activity-feed>
Accessibility
Host:role="feed" per the WAI-ARIA Feed pattern, labelled by aria-label (default Recent activity). While the feed is empty the role is group. If you set a role other than feed or group, the component leaves it alone.
Only articles are feed children: date headings and the infinite-scroll sentinel are in the DOM but carry aria-hidden="true". A heading's text instead becomes part of the description of the first article in its group. This means screen-reader heading navigation does not stop at date headings. The feed's own article navigation replaces it.
Each entry: native article role. aria-labelledby points at the entry's content (the actor verb object sentence) and aria-describedby points at its time, plus the date heading for the first entry of a group. Both use generated ids. If you set aria-label or aria-labelledby on an entry yourself, the component keeps it.
Position:aria-posinset is always set. aria-setsize is the real count, or -1 (unknown) while data-infinite is on, because more entries may load.
Loading:aria-busy="true" while a load-more request is outstanding. See Infinite scroll for how it ends.
Times:<time datetime> with the absolute timestamp in title; relative text auto-refreshes every 60s.
Keyboard: the feed is a single Tab stop (roving tabindex). Tab lands on the current entry, which starts as the first, and focusing anything inside an entry makes it the current one.
Page Down / Page Up: next / previous article. These work while focus is on the article or on a link or button inside it (APG).
Ctrl+End / Ctrl+Home: move focus to the first focusable element after the feed, or the last one before it (APG).
Arrow keys and plain Home / End are not handled, so they keep scrolling the page and driving screen-reader browse-mode reading. Keys are only handled while focus is inside the feed, and never in a text field or select inside an entry.
ISO-8601 timestamp. Or author a direct-child <time datetime> instead (works without JS).
data-activity-avatar
Avatar URL (renders <user-avatar>).
data-activity-icon
icon-wc name (alternative to avatar).
Events
Event
Bubbles
Detail
activity-feed:load-more
yes
{ done() } — call done() to clear aria-busy and re-arm the sentinel.
JavaScript API
Method
Description
addEntry(data, opts?)
Insert an entry. data: { time, html, avatar?, icon? }; opts: { prepend? }.
removeEntry(entry)
Remove a single entry element.
clear()
Remove every entry (empty-state will appear).
entries
Snapshot array of the current entry elements (a new array on each read, not live).
loading
Read-only boolean: true while a load-more is outstanding (mirrors aria-busy).
Authors who prefer can also append <article data-activity> directly to the host — the internal MutationObserver picks up the new entry and decorates it.