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…
Page navigation patterns for multi-page content, tables, and search results.
Overview
Pagination helps users navigate through large sets of content split across multiple pages. These patterns use semantic <nav> elements with proper ARIA attributes for accessibility.
Key features:
Semantic HTML with aria-label for screen readers
Current page indication via aria-current="page"
Disabled states for first/last page boundaries
Responsive design that works on all screen sizes
Keyboard navigation support
Simple Prev/Next
A minimal pagination with just Previous and Next buttons. Best for sequential content like blog posts or articles where page numbers are less important.
Pagination with numbered page links for direct page access. Includes ellipsis for large page ranges. Best for search results, product listings, or any content where users may want to jump to specific pages.
Complete pagination bar with result count, page navigation, and page size selector. Best for data tables and admin interfaces where users need full control over data display. The bar is a <footer> because it closes the table or list it belongs to: put it inside that <article> or <section>, where it is not a page landmark.
Full pagination with info and page size
<footerclass="pagination-bar"><pclass="pagination-info"aria-live="polite"> Showing <strong>21</strong> to <strong>30</strong> of <strong>97</strong> results</p><navclass="pagination"aria-label="Pagination"><ul><li><ahref="#"data-prevaria-label="First page"><icon-wcname="chevrons-left"size="sm"></icon-wc></a></li><li><ahref="#"data-prevaria-label="Previous page"><icon-wcname="chevron-left"size="sm"></icon-wc></a></li><li><ahref="#">1</a></li><li><ahref="#">2</a></li><li><ahref="#"aria-current="page">3</a></li><li><ahref="#">4</a></li><li><ahref="#">5</a></li><li><spandata-ellipsis>...</span></li><li><ahref="#">10</a></li><li><ahref="#"data-nextaria-label="Next page"><icon-wcname="chevron-right"size="sm"></icon-wc></a></li><li><ahref="#"data-nextaria-label="Last page"><icon-wcname="chevrons-right"size="sm"></icon-wc></a></li></ul></nav><pclass="page-size-selector"><labelfor="page-size">Show:</label><selectid="page-size"aria-label="Items per page"><optionvalue="10">10</option><optionvalue="25"selected>25</option><optionvalue="50">50</option><optionvalue="100">100</option></select><spanaria-hidden="true">per page</span></p></footer>
Disabled States
When on the first or last page, disable the corresponding navigation button to indicate the boundary. Use a <button> element with the disabledattribute instead of a link.
Disabled pagination states
<!-- First page - Previous disabled --><navclass="pagination"aria-label="Pagination"><ul><li><buttontype="button"disabledaria-label="Previous page"><icon-wcname="chevron-left"size="sm"></icon-wc></button></li><li><ahref="#"aria-current="page">1</a></li><li><ahref="#">2</a></li><li><ahref="#">3</a></li><li><spandata-ellipsis>...</span></li><li><ahref="#">10</a></li><li><ahref="#"data-nextaria-label="Next page"><icon-wcname="chevron-right"size="sm"></icon-wc></a></li></ul></nav><!-- Last page - Next disabled --><navclass="pagination"aria-label="Pagination"><ul><li><ahref="#"data-prevaria-label="Previous page"><icon-wcname="chevron-left"size="sm"></icon-wc></a></li><li><ahref="#">1</a></li><li><spandata-ellipsis>...</span></li><li><ahref="#">8</a></li><li><ahref="#">9</a></li><li><ahref="#"aria-current="page">10</a></li><li><buttontype="button"disabledaria-label="Next page"><icon-wcname="chevron-right"size="sm"></icon-wc></button></li></ul></nav>
CSS Styles
The base pagination styles are included in the nav element styles. These provide consistent sizing, hover states, and current page highlighting:
The pagination bar styles for the full variant (info text, nav, and page size selector) are included in VB's stylesheet. The layout uses CSS Grid to keep the nav centered while info and selector fill the remaining space. A container query handles responsive stacking:
Pagination bar styles (included in VB)
/* Pagination bar layout — included in VB nav styles */.pagination-bar {display: grid;grid-template-columns: 1fr auto 1fr;align-items: center;gap: var(--size-m);padding: var(--size-m);background: var(--color-surface-raised);border-radius: var(--radius-m);}.pagination-info {font-size: var(--font-size-s);color: var(--color-text-muted);}.page-size-selector {display: flex;align-items: center;justify-self: end;gap: var(--size-xs);font-size: var(--font-size-s);color: var(--color-text-muted);}/* Responsive stacking via container query */@container (max-width: 500px) {.pagination-bar {grid-template-columns: 1fr;justify-items: center;text-align: center; }.pagination-barnav.pagination {order: -1; }.pagination-bar.page-size-selector {justify-self: center; }}
Usage Notes
Accessibility
Always wrap pagination in a <nav> element with aria-label="Pagination"
Mark the current page with aria-current="page"
Add aria-label to icon-only buttons (e.g., "Previous page", "Next page")
Use the disabledattribute on buttons for first/last page states
Add aria-live="polite" to the results count (.pagination-info) so screen readers announce updates when the page changes
Add aria-label="Items per page" on the page-size <select> for a complete accessible name
Ensure all interactive elements are keyboard accessible
When to Use Each Variant
Simple: Blog posts, articles, tutorials - sequential content where page numbers matter less
Numbered: Search results, product catalogs - when users need to jump to specific pages
Full: Data tables, admin dashboards - when users need result counts and page size control
Implementation Tips
For server-rendered pages, use <a> elements with proper URLs
For SPAs, use <button> elements with click handlers
Consider hiding page numbers on mobile and showing only prev/next
For very large datasets, consider infinite scroll as an alternative