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…
Error page patterns for 404, 500, and maintenance states. Guide users with clear messaging and helpful actions.
Overview
Error pages appear when something goes wrong or content is unavailable. They should clearly communicate the issue, reassure users, and provide actionable next steps to get them back on track.
Key features:
Full-page centered layout using data-layout="cover"
Large error codes or icons for immediate recognition
Clear, concise messaging explaining the situation
Primary action button to help users recover
Secondary links for alternative navigation options
404 - Page Not Found
A 404 page appears when users navigate to a URL that doesn't exist. Display a prominent error code, explain the issue, and provide navigation options.
error-404.html
<bodydata-layout="cover"data-layout-min="xl"data-layout-padding="l"><maindata-layout="center"data-layout-max="narrow"data-layout-principaldata-layout-intrinsicdata-layout-textdata-layout-gap="xl"><spanclass="error-code">404</span><hgroupclass="spaced"data-align="center"><h1>Page not found</h1><p>Sorry, we couldn't find the page you're looking for. It may have been moved or deleted.</p></hgroup><footerdata-layout="stack"data-layout-gap="m"data-layout-align="center"><ahref="/"class="button"><icon-wcname="home"></icon-wc> Go back home</a><navclass="horizontal"aria-label="Additional navigation"><ul><li><ahref="/search">Search</a></li><li><ahref="/sitemap">Sitemap</a></li><li><ahref="/contact">Contact support</a></li></ul></nav></footer></main></body>
Error Code Styles
The oversized status number is this recipe's own look, so it keeps a class. Everything else is layout attributes: data-layout-intrinsic centers each child and data-layout-text centers the text.
A 500 page appears during server-side errors. Use a warning icon, acknowledge the problem, and offer options to retry or navigate elsewhere.
error-500.html
<bodydata-layout="cover"data-layout-min="xl"data-layout-padding="l"><maindata-layout="center"data-layout-max="narrow"data-layout-principaldata-layout-intrinsicdata-layout-textdata-layout-gap="xl"><icon-wcname="alert-triangle"size="2xl"></icon-wc><hgroupclass="eyebrow spaced"data-align="center"><p>Error 500</p><h1>Something went wrong</h1><p>We're experiencing technical difficulties. Our team has been notified and is working on a fix. Please try again later.</p></hgroup><layout-clusterdata-layout-gap="m"data-layout-justify="center"><buttontype="button"data-action="reload"><icon-wcname="refresh-cw"></icon-wc> Try again</button><ahref="/"class="button secondary"><icon-wcname="home"></icon-wc> Go back home</a></layout-cluster><navclass="horizontal"aria-label="Additional navigation"><ul><li><ahref="/status">Check system status</a></li><li><ahref="/contact">Contact support</a></li></ul></nav></main><script>document.querySelector('[data-action="reload"]') .addEventListener('click', () => location.reload());</script></body>
The status line is an eyebrow (hgroup.eyebrow) above the heading. The icon is tinted by one element rule: main > icon-wc { color: var(--color-error); }.
Maintenance Mode
A maintenance page displays during scheduled downtime. Communicate the situation, provide an estimated return time, and offer ways to stay updated.
error-maintenance.html
<bodydata-layout="cover"data-layout-min="xl"data-layout-padding="l"><maindata-layout="center"data-layout-max="narrow"data-layout-principaldata-layout-intrinsicdata-layout-textdata-layout-gap="xl"><icon-wcname="wrench"size="2xl"></icon-wc><hgroupclass="spaced"data-align="center"><h1>Under maintenance</h1><p>We're currently performing scheduled maintenance to improve our services. We'll be back shortly.</p></hgroup><layout-badgedata-color="info"data-size="l"><icon-wcname="clock"size="sm"></icon-wc> Estimated return: <timedatetime="14:00-05:00">2:00 PM EST</time></layout-badge><layout-stackdata-layout-gap="s"data-layout-align="center"><p><small>Get notified when we're back online:</small></p><formclass="inline"action="/notify"method="POST"><form-field><labelfor="notify-email"class="visually-hidden">Email address</label><inputtype="email"id="notify-email"name="email"placeholder="Enter your email"requiredautocomplete="email"/></form-field><buttontype="submit">Notify me</button></form></layout-stack><layout-stackdata-layout-gap="s"data-layout-align="center"><p><small>Follow us for updates:</small></p><navclass="horizontal"aria-label="Social media"><ul><li><ahref="https://twitter.com"aria-label="Twitter"><icon-wcname="twitter"></icon-wc></a></li><li><ahref="https://facebook.com"aria-label="Facebook"><icon-wcname="facebook"></icon-wc></a></li><li><ahref="/status"aria-label="Status page"><icon-wcname="activity"></icon-wc></a></li></ul></nav></layout-stack></main></body>
No classes beyond VB's own: <layout-badge> carries the return time, form.inline puts the email field beside its button, and nav.horizontal lays out the social links. Inside a data-layout-intrinsic center, group children with <layout-stack> rather than <section>: a section is an inline-size container, so as a content-sized flex item it collapses to zero width.
Configuration
Error pages are built from layout primitives. Here are the key components:
Element
Purpose
Customization
data-layout="cover"
Full-page vertical centering
Set minimum height with data-layout-min
data-layout="center"
Horizontally centers content
Control width with data-layout-max
data-layout="stack"
Vertical spacing between elements
Adjust gap with data-layout-gap
<icon-wc>
Visual indicator of error type
Size via the sizeattribute (xs to 2xl), color via CSS
data-layout="cluster"
Horizontal grouping of actions
Alignment with data-layout-justify
Accessibility
<main> landmark: Each error page wraps content in a <main> element, giving screen readers a clear landmark for the primary content.
Single <h1>: Each page uses exactly one <h1> describing the error, maintaining proper heading hierarchy.
Decorative icons: All <icon-wc> elements render with aria-hidden="true" by default, keeping them out of the accessibility tree.
Navigation landmark: Secondary links are wrapped in <nav aria-label="Additional navigation"> so screen readers can identify them as a navigation region.
No JavaScript required: All error pages are fully server-rendered. The 500 page's retry button uses progressive enhancement via an event listener rather than an inline handler.
Icon Options
Choose icons that clearly indicate the error type. Common icons from the Lucide set:
Icon
Name
Use For
alert-triangle
Server errors, warnings
file-x
File not found, 404 errors
wrench
Maintenance mode
wifi-off
Connection issues
lock
Access denied, 403 errors
clock
Timeout errors
server-crash
Server down
shield-alert
Security errors
Usage Notes
HTTP status codes: Set the correct HTTP status code (404, 500, 503) in your server response, not just display it visually
Error tracking: Log errors server-side for debugging while showing user-friendly messages to visitors
Keep it simple: Avoid technical jargon; explain the issue in plain language
Provide options: Always give users at least one action to recover (go home, retry, search)
Brand consistency: Match your site's design to maintain trust during error states
Accessibility: Ensure error pages work without JavaScript and are screen reader friendly
SEO considerations: 404 pages should not be indexed; use proper meta robots tags
Maintenance ETA: If possible, provide estimated return times to set user expectations