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…
Unified pattern for empty, loading, and error states. State-driven feedback with semantic HTML and accessible output elements.
Overview
Feedback states communicate container status to users. Instead of separate components, this pattern uses a single data-attribute system to toggle between empty, loading, and error states.
Key concepts:
data-state="empty|loading|error" on the container controls visibility
output[data-empty|loading|error] elements contain state-specific feedback
.content class marks the populated content (table, ul, ol, dl, articles)
A container with a single empty state feedback output.
Basic structure
<sectionid="messages"data-state="empty"><h2>Messages</h2><!-- Populated content --><ulclass="content"><li>Message 1</li></ul><!-- Feedback for empty state --><outputdata-emptydata-feedback="message"role="status"><icon-wcname="inbox"></icon-wc><h3>No messages</h3><p>Messages will appear here.</p></output></section>
Multiple States
A single container can have feedback for multiple states. Only the matching feedback is visible based on data-state.
A table with all three feedback states. Use the buttons to toggle between states.
List Examples
Unordered list (notifications) and ordered list (leaderboard) with feedback states. The notifications use a message-style loading state, while the leaderboard uses skeleton lines.
Description List Example
A product specifications panel using a description list (<dl>) with skeleton loading feedback.
Articles Example
Blog posts as a collection of articles with feedback states for empty, loading, and error conditions.
Feedback Types
Use data-feedback to control the presentation style of feedback outputs.