"Bento layout" KPI indicator. Asymmetric tile sizes, sparkline as a low-opacity background on each tile, big numerals layered over the chart in the lower-left corner. Hero (Monthly Revenue) spans two rows on the left; two stacked tiles on the right (top); three equal tiles below — magazine-style mixed sizes rather than a uniform grid. Card-level container query collapses the whole bento to a single-column stack when the host card narrows below 700px so the same markup works in narrow page-grid cells.

Key Performance Indicators

LIVE
Monthly Revenue
+12.8%
$849K
Completion Rate
+2.8%
86.5%
Server Capacity
+21.0%
85.9%
Server Temp
-2.1%
24.0°C
Error Rate
-30.9%
0.28%
Tokyo Office
+8.1%
¥12.1M

Monthly Revenue
+12.8%
$849K
Completion
+2.8%
86.5%
Capacity
+21.0%
85.9%
Server Temp
-2.1%
24.0°C
Error Rate
-30.9%
0.28%
Tokyo
+8.1%
¥12.1M
Quarterly Bookings
+18.4%
2.4M
NPS
+4
62
CSAT
±0.0%
94.1%
DAU
+6.2%
42.7k
Churn
+0.4%
3.1%
Conversion
+1.2%
5.7%
Cloud Spend
+9.4%
$128k
Latency
-12.0%
142ms
Uptime
+0.04%
99.99%
Tickets
+22%
387
Active Users
+3.8%
128k
Build Time
-31%
3.2m

Revenue
+12.8%
$849K
Done
+2.8%
86.5%
Capacity
+21%
85.9%
Temp
-2.1%
24.0°C
Errors
-31%
0.28%
Tokyo
+8.1%
¥12.1M
Monthly Revenue
+12.8%
$849K
Completion
+2.8%
86.5%
Capacity
+21.0%
85.9%
Server Temp
-2.1%
24.0°C
Error Rate
-30.9%
0.28%
Tokyo Office
+8.1%
¥12.1M
Bookings
+18%
2.4M
NPS
+4
62
CSAT
±0.0%
94.1%
DAU
+6.2%
42.7k
Churn
+0.4%
3.1%
Convert
+1.2%
5.7%

Custom chart library · Chart.js in the chart slot

The pa-kpi-bento-tile__chart slot is a plain positioned container — the inline SVG sparkline is just the lightweight default. Each tile below swaps a <canvas data-kpi-chart> in where the <svg> was, rendering a Chart.js bar chart as the tile background instead of the area sparkline — visibly a different chart, same slot. The tile still sets color: var(--pa-kpi-accent), so the bars read currentColor for their sentiment hue and re-colour on theme change — no per-tile chart config needed.

Key Performance Indicators

LIVE
Monthly Revenue
+12.8%
$849K
Completion Rate
+2.8%
86.5%
Server Capacity
+21.0%
85.9%
Server Temp
-2.1%
24.0°C
Error Rate
-30.9%
0.28%
Tokyo Office
+8.1%
¥12.1M

Usage Guide

When to use

Magazine-cover dashboards where one headline KPI deserves disproportionate visual weight, with supporting metrics arranged around it. Sparklines sit behind the values rather than alongside them. Best for marketing pages, exec summaries, and "today at a glance" hero panels. If you want even visual weight across all KPIs, pick Editorial minimal or Numeric strip.

6-tile asymmetric grid

The grid uses CSS grid-template-areas arranged as a 6-col × 3-row layout: hero takes the left half across the top two rows; two stacked tiles fill the right half of those rows; three equal tiles span the bottom row. Tile placement is by source order via :nth-child rules — authoring just lists six tiles in reading order. To rearrange, edit the named-area template; the markup stays unchanged.

Sparkline-behind-value layering

Each tile is an internal 2-row grid ("label delta" / "value value"). The value sits at the bottom-left layered over an absolutely-positioned chart underneath it (z-index: 1 on the value, z-index: 0 on the chart). The sparkline reads through behind the digits rather than living in its own column. Polygon fill is opacity: 0.10 and polyline is stroke-opacity: 0.55 so the chart doesn't compete with the headline number.

Container-relative typography

Hero value: clamp(3.6rem, 22cqi, 7rem). Non-hero: clamp(2rem, 14cqi, 3.2rem). cqi resolves against the tile's width (each tile is its own container via container-type: inline-size), not the card's. So at narrow page-grid widths the digits scale down without manual breakpoints, and at wide canonical widths the hero number gets dramatic without overflowing.

Narrow-width collapse

Card-level container query at max-width: 700px collapses the whole bento to a single-column stack and resets grid-area: auto on every tile so the same markup works inside narrow page-grid cells (1×3 widths, 25% asymmetric placements).

Hover detail popover

Cursor-anchored via Floating UI's computePosition + virtual reference element built from e.clientX/clientY. Same recipe as the other KPI showcases. Sparkline trailing dots use the SVG <circle> → HTML <span> conversion to stay circular at non-square chart aspect ratios (the chart's preserveAspectRatio="none" would otherwise stretch the dot into an oval).


CSS Classes Reference

Card structure

  • pa-kpi-bento — page-namespace class on .pa-card.
  • pa-kpi-header — flex header with title + LIVE indicator.
  • pa-kpi-live / pa-kpi-live__dot — LIVE pill + animated dot.
  • pa-kpi-bento__body — card body with internal padding (the bento's outer breathing room).
  • pa-kpi-bento__grid — 6×3 named-area grid; :nth-child rules assign each tile to its area.
  • pa-kpi-footer — flex footer caption.

Tiles

  • pa-kpi-bento-tile — single tile (declares its own container-type: inline-size for cqi-relative typography). Carries --pa-kpi-accent.
  • pa-kpi-bento-tile--hero — hero modifier: bigger value (22cqi), bigger min-height in collapsed mode.
  • pa-kpi-bento-tile--positive / --negative / --neutral / --up-strong / --down-strong — sentiment modifiers setting --pa-kpi-accent on the tile.

Tile content

  • pa-kpi-bento-tile__label — uppercase mono caption (top-left of the internal 2-row grid).
  • pa-kpi-bento-tile__delta — coloured Δ% (top-right; reads --pa-kpi-accent).
  • pa-kpi-bento-tile__value — focal number row (bottom span of the tile, layered over the chart at z-index: 1).
  • pa-kpi-bento-tile__num / pa-kpi-bento-tile__unit — numeric + unit spans inside __value.
  • pa-kpi-bento-tile__chart — absolutely-positioned chart wrapper (z-index: 0, sits behind the value).
  • pa-kpi-bento-tile__chart-svg — fixed-height pinned-to-bottom span containing the SVG (so vertical stretch doesn't distort the line).

Hover detail popover

  • pa-kpi-detail — popover root (moved to <body> on init; position: fixed, hidden until data-show).
  • pa-kpi-detail__title — uppercase mono header.
  • pa-kpi-detail .pos / .neg / .warn — sentiment-coloured <dd> text.

Framework tokens used by this showcase

  • --pa-very-positive / --pa-positive / --pa-neutral / --pa-negative / --pa-very-negative — 5-step semantic sentiment scale.
  • --pa-warning — orange "off-target / approaching limit" signal.
  • --pa-detail-bg / --pa-detail-text / --pa-detail-row-label / --pa-detail-title / --pa-detail-shadow — popover chrome.
Type / for commands, : to search a category, or just start typing

Settings

Body text size. All elements scale proportionally.
👤

John Doe

Administrator
  • 📊 Dashboard
  • 📝 Forms
  • 📋 Tables
  • 📊 Data Grid