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

Stats

Metric cards and stat displays with numbers, labels, and change indicators. Perfect for dashboards and data summaries.

Overview

Stats patterns display key metrics at a glance. They combine large numbers with supporting context like labels, change indicators, and icons to help users quickly understand important data.

This page is the no-JS recipe. For the enhanced form with consistent layout, theme-driven trend coloring, drill-down anchors, and skeleton loading, use <score-card>. Adopting it is a small markup change: shadow-DOM slots only accept direct children, so the title, value, and change move out of the <figure> and sit directly under <score-card> with slot attributes (see score-card's static fallback).

Key features:

  • Semantic HTML using <figure>, <figcaption>, and <data>
  • Machine-readable values via the value attribute on <data>
  • Trend indicators using data-trend attributes
  • Scoped CSS for minimal class usage
  • Responsive grid layout

Simple Number Grid

A clean grid of stat figures with labels and large numbers. Each stat uses a <figure> element with a <figcaption> for the label and <data> for the machine-readable value. data-layout="grid" lays them out; the scoped CSS keys on the figure's own structure, so no class is needed.

With Change Indicators

Stats with trend indicators showing change from a previous period. Uses <small> with a data-trend attribute for semantic color styling. The percentage change is wrapped in a nested <data> element for machine-readability.

Card-Based Stats

Each stat in its own card with an icon for visual distinction. At this point the recipe is exactly what <score-card> packages: title, value, change and icon slots, with trend="up|down" colouring the change.

No custom CSS: <score-card> draws the tile, sizes the value and places the icon.

Semantic Benefits

This pattern uses semantic HTML elements that provide meaning beyond visual presentation:

  • <figure>: Groups the stat as a self-contained unit of content
  • <figcaption>: Provides the label/caption for the figure
  • <data value="">: Contains machine-readable values for parsing by scripts or assistive technologies. The value attribute holds the raw number while the text content shows the formatted display. Can be nested inside <small> to make change percentages machine-readable too
  • <small>: Indicates secondary information (the trend/change indicator)

Usage Notes

  • Machine-readable values: Always include the raw number in the value attribute (e.g., value="24521" for "24,521" or value="0.032" for "3.2%"). Use nested <data> inside trend indicators for machine-readable change values (e.g., <data value="0.125">+12.5%</data>)
  • Color semantics: Use data-trend="up" for positive trends and data-trend="down" for negative trends
  • Accessibility: The semantic structure helps screen readers understand the relationship between labels and values
  • Responsive: The grid automatically adjusts column count based on container width
  • Context: Include context in trend indicators (e.g., "vs last month") so users understand what the change refers to

Related

Data Element

Machine-readable values

Figure Element

Self-contained content

Layout Card

Card container element

Dashboard

Full dashboard layouts with stats

score-card

Enhanced KPI tile component

↑