Skip to content
Haze UI

Stats: featured metric with supporting results

One prominent result paired with a vertical list of supporting figures.

pnpm dlx shadcn@latest add @haze/stats-highlight
Open preview in a new tab
Liveno JavaScript

When to use

  • One result deserves more emphasis than the other measures
  • A small group of related metrics supports a concise story

When not to use

  • Every figure should have equal visual weight; use stats-row

Installation

Add the Haze registry to components.json once, then install Stats: featured metric with supporting results with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/stats-highlight
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
idstring"stats-highlight"Unique section ID prefix.
eyebrowstring"A closer look"Label above the section heading.
titlestringdemo headingHeading for the results.
descriptionstringdemo copyContext for the metrics; the default identifies them as illustrative.
headingLevel1 | 2 | 32Section heading level.
primary{ value: string; label: string; detail: string }example metricFeatured result and context; replace the example with verified information.
metrics{ value: string; label: string }[]3 example metricsSupporting figures and their labels.
classstring–Additional section classes.

Accessibility

  • Labels and figures are expressed as description lists so values retain their context.
  • The default figures are explicitly marked as examples and must be replaced with real evidence.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI block "Stats: featured metric with supporting results" with `npx shadcn@latest add @haze/stats-highlight`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import StatsHighlight from "@/components/haze/blocks/stats-highlight.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/blocks/stats-highlight.md

  • Customize with real content

    Adapt the Haze stats-highlight block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, primary, metrics, class. Keep the layout, the heading level rules and these accessibility details: Labels and figures are expressed as description lists so values retain their context. The default figures are explicitly marked as examples and must be replaced with real evidence. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using stats-highlight, check it fits: use it when one result deserves more emphasis than the other measures; a small group of related metrics supports a concise story. Avoid it when every figure should have equal visual weight; use stats-row. Alternatives: @haze/stats-row.

Dependencies

  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog