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…
Navigation sections containing links to other pages or parts of the page. Used for primary navigation, table of contents, breadcrumbs, and pagination.
Usage
Use the <nav> element for:
Primary site navigation in the header
Secondary navigation in sidebars or footers
Breadcrumb navigation
Table of contents
Pagination links
Hierarchical disclosure navigation for documentation sidebars (see .tree below) — not application tree widgets
Not all groups of links need to be in a nav element. Reserve nav for major navigation blocks. Use aria-label or aria-labelledby to distinguish multiple nav elements.
Breadcrumb navigation with separator characters. Use <ol> for proper semantics, give the <nav> an aria-label and mark the last crumb aria-current="page". This is the zero-JavaScript breadcrumb; separators are decorative CSS (empty alt text) and are not announced. For JSON-LD, auto-generation from the URL or an expandable collapsed trail, use <bread-crumb>.
The default separator is “›”, from the --sep-breadcrumb token. Use data-separator to change it. In a right-to-left trail (dir="rtl") the directional separators flip: the default and chevron become “‹” and arrow becomes “←”. The RTL default comes from --sep-breadcrumb-rtl, so set both tokens if you change the glyph.
Use data-collapsed to hide middle items for deep hierarchies: the first crumb, the parent (second-to-last) and the current page stay visible, with a decorative ellipsis before the parent. Without JavaScript the hidden crumbs cannot be reached, so prefer <bread-crumb data-collapsed>, which adds a "Show full path" button. Put data-truncated on an <li> to ellipsize a long label.
Collapsed breadcrumb
<navclass="breadcrumb"data-collapsedaria-label="Breadcrumb"><ol><li><ahref="#">Home</a></li><li><ahref="#">Level 1</a></li><li><ahref="#">Level 2</a></li><li><ahref="#">Level 3</a></li><li><ahref="#">Level 4</a></li><li><spanaria-current="page">Current Page</span></li></ol></nav><navclass="breadcrumb"aria-label="Article breadcrumb"><ol><li><ahref="#">Home</a></li><lidata-truncated><ahref="#">A very long section title that will not fit</a></li><li><spanaria-current="page">Current Page</span></li></ol></nav>
.bottom
Sticky bottom tab bar for mobile navigation. Stacks icon and label vertically in each link and pads for the device safe area. Add .frosted (class="bottom frosted") for a translucent, blurred background that lets content show through; it uses the --glass-* tokens.
Ellipsis, simple (prev/next only), and compact (connected buttons) variants.
Simple pagination
<navclass="pagination"data-variant="simple"aria-label="Pagination"><ul><li><ahref="#"data-prev>Previous</a></li><li><spandata-info>Page 3 of 10</span></li><li><ahref="#"data-next>Next</a></li></ul></nav>
A three-column bar for result lists: result count, the pagination nav, and a page-size picker. Put .pagination-bar on a wrapper such as <footer>, with .pagination-info and .page-size-selector on its other children. Inside a container narrower than 500px the bar stacks, with the pagination first. The pagination list itself wraps onto more lines on narrow screens rather than overflowing.
Pagination bar
<footerclass="pagination-bar"><pclass="pagination-info">Showing <strong>21</strong> to <strong>30</strong> of <strong>97</strong> results</p><navclass="pagination"aria-label="Results pages"><ul>…</ul></nav><pclass="page-size-selector"><labelfor="page-size">Show</label><selectid="page-size">…</select><span>per page</span></p></footer>
A step indicator for multi-step flows (checkout, onboarding). Use an <ol>; the circles are numbered by a CSS counter. Mark the current step aria-current="step" and finished steps data-completed (the number becomes a check mark). A link inside a completed step lets people go back. data-labels="below" puts labels under the circles, data-direction="vertical" stacks the steps, and data-size="sm|lg" changes the circle size. Connectors use logical properties, so the indicator mirrors in right-to-left pages.
Interactive wizards, validation and more layouts are on the Steps pattern page.
Right to left
Every variant uses logical properties. Breadcrumb separators flip, step connectors run from the inline start, and compact pagination and tree links round the correct ends.
Dropdowns in a nav
Put a <drop-down> in a nav list item for a sub-menu. The trigger picks up the nav’s link padding, colours and hover, and gets a chevron that turns when open. Mark the trigger aria-current="true" (or .active) when the current page is in its section. The menu keeps its pop-up behaviour at every width; a phone layout that needs a different pattern should use <nav-bar> or a mobile menu.
Bottom border indicators with underline on current page
.breadcrumb
Horizontal list with separators; supports data-separator, data-collapsed, data-truncated
.minimal
Subtle muted links with minimal padding
.pagination
Page navigation with prev/next controls; supports data-variant, data-size
.tree
Hierarchical disclosure navigation using <details>/<summary>; supports data-density. Not an ARIA tree widget.
.bottom
Sticky bottom tab bar for mobile; flex row with icon+label stacking and safe-area padding
.bottom.frosted
Translucent, blurred bottom bar (--glass-* tokens)
.steps
Step indicator; supports data-labels="below", data-direction="vertical", data-size; steps use aria-current="step" and data-completed. See the Steps pattern
Changes the separator character (default is “›” from --sep-breadcrumb; flips in RTL)
data-collapsed
boolean
Hides middle items: shows the first crumb, a decorative ellipsis, the parent and the current page. Hidden crumbs are not reachable without JS; use <bread-crumb> for an expand button.
data-truncated
on item
On an <li>: truncates its link label with an ellipsis (max 10rem)
Colour is not the only cue: in the default, .horizontal, .vertical, .minimal and .bottom navs the current link is also underlined (WCAG 1.4.1). Variants that mark it another way turn the underline off: .pills and .pagination (fill), .tabs (border), .tree (inline-start bar) and .breadcrumb (position). Set --nav-active-decoration: none on a nav to remove it when you add your own non-colour cue. The underline is locked the same way as the colour, because many themes remove link underlines.
.minimal uses body text color and weight as well as the underline. .pills and .pagination fill the current item with --color-interactive and pick black or white text for it automatically (contrast-color(), with --color-text-on-interactive as the fallback in older browsers).
Why tokens rather than a color rule: many themes color links, and theme styles sit in a higher cascade layer than nav. Nav therefore locks the current item's text color with !important so no theme can make it vanish; that rule reads the tokens above, so they are the way to change it. A test renders the current item under every theme to keep it legible.
Accessibility
Nav creates a navigation landmark for screen reader navigation
Use aria-label to distinguish multiple nav elements (e.g., "Main navigation", "Footer navigation")
Use aria-current="page" on the link to the current page
Breadcrumbs should use <ol> for ordered sequence semantics
Ensure sufficient color contrast for link text and focus states
Links should have visible focus indicators
Tree navigation uses native <details>/<summary> which are keyboard accessible and announce expand/collapse state
Related
<header> - Primary nav typically lives in site headers