Metric ticker
A strip of figures: label, counter, delta chip, sparkline. It wraps, scrolls sideways, or moves as a marquee.
Anatomy
┌──────────────────────────┬──────────────────────────┬──────────┐
│ MRR │ Error rate │ Queue │ label · meta, fg-muted
│ $48,200 [↑ +3.2%] ╱╲╱ │ 0.42% [↓ -12%] ╲╲_ │ 1,204 │ counter · chip · sparkline
└──────────────────────────┴──────────────────────────┴──────────┘
radius-control · border · surface · a divider before each item
| Part | Token | Why |
|---|---|---|
| Figure | ds::counter, md / lg / xl for sm / md / lg | Rolls on a re-render with the script; plain text without. |
| Chip | stat tile's tints, with arrow-up / arrow-down | The stat tile's rules: sign picks the colour, an arrow says which way. Zero is neutral, no sign. An item's rising: bad swaps the two tones (as stat tile's rising), never the sign or the arrow. |
| Trend | ds::sparkline in the item's tone | |
| Divider | border-s border-divider on every item, list pulled -ms-px, box clipping | The first item on each wrapped line has its rule outside the box, so no line starts with one. not-first: put a rule at the start of every line after the first. |
Modes
- wrap:
flex-wrap. - scroll: one line,
overflow-x-auto,snap-x snap-mandatory, each itemsnap-start. The scroll box is a named region withtabindex="0". - marquee: the list drawn twice in a
w-maxtrack moved by themarqueeutility (theme.css:ds-marqueefrom 0 to -50%, or +50% in RTL, overitems × 5s, linear, infinite). The second copy isaria-hiddenandinert, with no live regions. Paused byanimation-play-stateon hover, focus-within, and while the pause button isaria-pressed="true".
Reduced motion
The marquee does not move: motion-safe:marquee only, the copy
motion-reduce:hidden, the pause button hidden, and the viewport becomes the
scroll mode's (overflow-x-auto, snapping). A slower marquee is still motion.
The pause button
A press flips its own aria-pressed, which the track reads through
group-has-[…]. No Alpine: the marquee needs none, so its control does not
either. The flip is the include's one document listener (press.js, batch
30D), not an inline onclick, which a strict Content Security Policy
refuses. Its icon is ds::icon-swap, pause to play.
Accessibility
| Root | role="group", named by label; a list inside |
| Live | none by default; one item's announce makes it aria-live="polite", aria-atomic |
| Marquee | pausable, stops on hover and focus, still under reduced motion (WCAG 2.2.2) |
| Delta | arrow and sign as well as colour |
Do not
- Do not make the whole strip a live region. It would never stop talking.
- Do not let the marquee move under reduced motion, even slowly.
- Do not put interactive content in the copy. It is inert for a reason.
From the package repo: edit this page on GitHub.