Statistics
Elevate key measurements and contextual changes.
Live preview
Monthly active users
24,892
↑ 12.4% this month
Average response
118ms
↓ 8ms this month
HTML
<div class="xsh-grid" style="width:100%">
<div class="xsh-stat">
<div class="xsh-stat__label">Monthly active users</div>
<div class="xsh-stat__value">24,892</div>
<div class="xsh-stat__delta">↑ 12.4% this month</div>
</div>
<div class="xsh-stat">
<div class="xsh-stat__label">Average response</div>
<div class="xsh-stat__value">118ms</div>
<div class="xsh-stat__delta">↓ 8ms this month</div>
</div>
</div>Installation & markup
Include the local stylesheet and script once on the page, then place the component inside a data-xsh-ui root. The example above works without a build system.
<link rel="stylesheet" href="/dist/xshna-ui.css">
<div data-xsh-ui>
<!-- Add the HTML example above -->
</div>
<script defer src="/dist/xshna-ui.js"></script>Component API
Public classes, attributes and hooks used by this example. Keep the xsh- prefix intact.
| Identifier | Contract |
|---|---|
xsh-stat | Used by the example markup and component styles or behavior. |
xsh-stat__label | Used by the example markup and component styles or behavior. |
xsh-stat__value | Used by the example markup and component styles or behavior. |
xsh-stat__delta | Used by the example markup and component styles or behavior. |
Accessibility & keyboard
Statistics are ordinary text, available to assistive technology and text selection.
Implementation note. Always state units and comparison periods; do not use color as the only performance indicator.
Interaction contract
Behavioral components use the shared delegated runtime; visual-only primitives rely on semantic HTML and CSS. Runtime controls emit bubbling xsh:* CustomEvents; bind application handlers to those events when server persistence, API data or navigation is required.