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

data-paged

Pagination upscale for any list-shaped container — native ul/ol/table or VB collections like card-list, data-table, layout-grid. Numbered, prev/next, load-more, and infinite styles. Optional URL state.

Overview

The data-paged attribute upscales any list-shaped container with pagination — native lists (<ul>, <ol>), tables (<table>, paginates the <tbody> rows), or VB collections (<card-list>, <data-table>, <layout-grid>). One attribute on the container, no per-element wiring; the script slices direct children, hides those outside the active page, and injects a <nav aria-label="Pagination"> sibling with the controls.

Styles

Four data-paged-style values cover the common pagination shapes:

numbered (default)
Prev / 1 2 3 … / Next. Best for indexed content like blog posts or product listings.
prev-next
Previous / "Page N of M" / Next. Best for linear sequences (tutorials, multi-step forms).
load-more
Single button reveals the next page worth of items in place. Best for activity-style feeds.
infinite
IntersectionObserver sentinel auto-loads more when scrolled into view. Best for endless feeds where users scroll without thinking about pages.

Attributes

AttributeDefaultNotes
data-paged—Opt-in (boolean).
data-paged-size10Items per page. 0 disables paging (single page covering all items).
data-paged-page1Initial page (1-based, user-facing).
data-paged-stylenumberednumbered · prev-next · load-more · infinite
data-paged-window2For numbered: page numbers shown around current before ellipsis kicks in.
data-paged-controlsafterbefore · after · both · none. none also drops the load-more button (pair it with <pager-wc data-style="load-more">); the infinite-scroll sentinel is not a control and always renders.
data-paged-url—Opt-in URL search-param name (e.g. page). When set, page state syncs to the address bar via the History API; back/forward re-render the matching page, and a URL without the parameter shows page 1.
data-label-navPaginationNav landmark name.
data-label-prev / data-label-nextPrevious / NextButton text.
data-label-pagePage {page}Accessible name of a page-number button.
data-label-statusPage {page} of {total}The prev-next status, and the announcement after a numbered page change.
data-label-load-moreLoad more ({n})Load-more text; {n} = items remaining.
data-label-no-moreNo moreExhausted load-more text.
data-label-showingShowing {visible} of {total}Announced after load-more / infinite reveal more items.

Localisation

The data-label-* strings are the same set <pager-wc> reads. They are read from the container or any ancestor, so one set on <html> or <main> translates every paged list; numbers are formatted for the container's closest [lang].

Events

The container emits paged:change (bubbles) after each render. visible is the number of items currently shown (it grows for load-more / infinite); style is the container's data-paged-style. Use it for analytics, scroll-restoration, or driving a sibling component such as <pager-wc>.

Composition recipe — content feed

The pattern that would have been <content-feed> is a recipe over existing primitives plus this attribute. No wrapper component required.

site-search handles filtering and highlighting; <card-list> handles template-driven rendering; data-paged handles paging and URL state. Each piece is independently testable and re-composable.

Accessibility

  • The injected nav uses <nav aria-label="Pagination"> with native <button>s — keyboard-navigable by default.
  • The active page button gets aria-current="page"; page-number buttons are named Page N. In forced-colors mode the current page keeps a Highlight fill and a thicker border.
  • The nav is swapped in place on each render, and focus returns to the equivalent control (Next stays on Next; on the last page it moves to the current page).
  • Prev/next on the first/last page get the native disabled attribute, so they are skipped by Tab and not actionable. (If you need them to stay focusable, drive the controls yourself with aria-disabled instead.)
  • Ellipsis markers (…) get aria-hidden="true" so screen readers don't announce them.
  • prev-next style includes a live status ("Page N of M") with aria-live="polite". The same node is kept across renders so the change is announced (with both, only the copy after the container is live).
  • numbered page changes are announced ("Page 2 of 5") through the shared polite live region; load-more and infinite announce how many items are shown ("Showing 20 of 54"). Focus stays on the Load more button, ready to load again.
  • See the note under Styles: infinite can make content after the list unreachable — prefer load-more.
  • Honours prefers-reduced-motion: no transitions on page change.

What gets paginated

The script paginates direct children of the host, with one exception: when the host is <table>, it paginates the <tbody> rows instead (so the <thead> and <tfoot> stay visible).

The injected <nav> nodes are placed as siblings of the host, not children — so they don't affect the host's grid / flex layout and don't trip its mutation observer.

↑