Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

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…

Read the release notes

activity-feed

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 thisWhen
<activity-feed>One-way, immutable timeline of "actor verb object" actions with relative timestamps.
<comment-thread>Threaded, mutable discussion with replies + reactions + edit/delete.
<recently-visited>Browser navigation history, scoped per-user / per-session.
<time-index>Changelog / version-filtered release timeline.
<chat-thread>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-time attribute. Inside the entry, you author the content however you like — the component does not dictate the verb vocabulary or object shape.

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.

Date grouping

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.

Avatar / icon left-rail

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.

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.

Empty state

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.

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.
  • Reduced motion: no entrance animations.

Attributes

AttributeTypeDefaultDescription
aria-labelstringRecent activityRegion label.
data-groupstringnonenone | day | week — date headings between entries.
data-infinitebooleanfalseAdds an IntersectionObserver sentinel; emits activity-feed:load-more; aria-setsize="-1". Remove it to end the feed.
data-empty-textstringNo recent activityEmpty-state text.

Per-entry attributes (on <article data-activity>)

AttributeDescription
data-timeISO-8601 timestamp. Or author a direct-child <time datetime> instead (works without JS).
data-activity-avatarAvatar URL (renders <user-avatar>).
data-activity-iconicon-wc name (alternative to avatar).

Events

EventBubblesDetail
activity-feed:load-moreyes{ done() } — call done() to clear aria-busy and re-arm the sentinel.

JavaScript API

MethodDescription
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).
entriesSnapshot array of the current entry elements (a new array on each read, not live).
loadingRead-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.

See also

↑