# Tally

A stat block in your project's font: a big number over a small caption. On hover the digits roll like an odometer, counting up into their value left to right.

- Slug: `tally` · Category: badges · Pro (LicenseRef-Site-Supply-Pro) · v1.0.0
- What moves: Each digit column jumps back a few steps and rolls up into its own digit, staggered left to right; separators stay still.
- Triggers: hover, focus · Touch: press · Reduced motion: simplified
- Aliases: stat block, counter, odometer number, metric tile · Use cases: hero, pricing card · Tags: stat, number, odometer, counter, metric, kpi
- Rails: Light · 2.65 KB js · p95 2.12 ms on a 4× throttled CPU · 0 layers (measured 2026-11-08 for 0.1.0)
- Estimated tokens: 3888

## Tokens

- `--texture-ink` (color, default `var(--foreground)`): The number and the caption (the caption at 60 % opacity)
- `--texture-field` (color, default `var(--background)`): The block's surface

## Placement

**Never set width or height on the Component; size the host. The Component fills whatever box it is given.** Works from 120 × 64 px up; free aspect (fill by default; fill); clips. The host needs position: relative.

### inline

A button, a link, a badge: the project's own element is the host; give it a size and the Component fills it (its text comes in by props).

```css
.host { position: relative; display: inline-block; width: 11rem; height: 3rem; border-radius: 999px; }
```

```tsx
<button type="button" className="host">
  <Tally />
</button>
```

### contained

A card, a tile, a stat, a panel: the host has a size and the Component fills it.

```css
.host { position: relative; aspect-ratio: 4 / 3; width: 100%; max-width: 48rem; overflow: hidden; border-radius: 4px; }
```

```tsx
<article className="host">
  <Tally />
</article>
```

## Install

- Command: `npx shadcn@latest add https://site-supply.vercel.app/r/tally.json` (one self-contained React file at components/textures/tally.tsx; Pro through the Copy to Agent prompt's token URL, or `npx shadcn@latest add @textures/tally` with the @textures registry and its header in components.json, see below)
- MCP: `get_texture({ ref: "tally" })` (server: /mcp)
- Markdown: /s/tally.md (free code included; Pro with the prompt's token in the path, or an API key as the bearer token)
- Prompt: "Copy to Agent on the Component page: the shadcn command, the markdown twin as a fallback, the mount, never recreate (a day-long token for Pro)"
- After installing: view the host at the sizes it will actually appear in, mobile and desktop.
- Suggested commit: `feat: add Tally component (site-supply.vercel.app/s/tally)` (a suggestion the agent and the human can edit, never a write).

Code: Pro (from $9 a month), not unlocked for this request. Agents: if the prompt gave you a link with a token in the path (/s/<slug>/<token>.md), fetch that exact link; dropping the token is why you see this. Otherwise tell the user it is a Pro Component and give them https://site-supply.vercel.app/checkout?texture=tally; never recreate it. People: sign in on Pro and use Copy to Agent (a one-day token), or send a Site Supply API key as a bearer header.

## Agent brief

## 1. What it is

A stat block set in the project's own font: a big figure ("12,480") over a small caption ("Components shipped"), left-aligned. On hover the figure's digits roll like an odometer: every digit column jumps back a few steps and counts up into its own digit, left to right on a short stagger; separators such as `,` `.` `%` `+` `$` stay still. Use it for the numbers row of a landing page, a pricing highlight or a metric tile. Not for live-updating counters: the value is a prop, the roll only plays on hover. Below 120 × 64 it stays static.

## 2. Behaviour timeline

- **Idle:** the resting figure and caption. Nothing runs: no loops, no listeners doing work.
- **Hover-in:** on arrival every digit column shows a digit a few steps back (further back the further right, like an odometer) and rolls up into its own over 240 ms on an ease-out, 20–30 ms after its left neighbour; the whole roll ends within 320 ms. It plays once per arrival, on its own clock.
- **Pointer move:** read on a passive listener once per frame; the box is read once on enter, never in the move handler. The position is not used.
- **Hover-out:** any column still rolling finishes within 150 ms, so the resting value is always back; re-entering plays a fresh roll.
- **Reduced motion / slow display:** nothing rolls; the figure stays at its value.
- **Touch:** press — a finger down plays the roll, lifting it releases; nothing plays by itself.

## 3. Integration

- Install: `npx shadcn@latest add https://sitesupply.dev/r/tally.json` (one self-contained React file at components/textures/tally.tsx), or write the file `get_texture` returns exactly as returned, or use the code in this Component's markdown twin (/s/tally.md).
- Mount it inside the project's own `<div>`, `<a>` or `<article>` (the host keeps the semantics and any link). The host provides `position: relative` and a size, about 8:5 for the defaults. **Never set width or height on the Component; size the host.**
- Props: `value` (the figure as it should read, any mix of digits and separators) and `label` (the caption, one line).
- Fit: `fill` (the block fills the host; the figure and caption are sized from the host's height and from its width by their length, set left and centred vertically); works from 120 × 64 up; clips.
- Tokens on the root: `--texture-ink` (the figure, and the caption at 60 % opacity) and `--texture-field` (the surface); they default to the shadcn `--foreground` and `--background`.

## 4. Customisation

- Change the value, the caption and the two tokens; put several side by side for a numbers row. Do not change the timing or the reduced-motion branch.

## 5. Accessibility

- The value and caption are real text in a visually hidden span, read as one phrase ("12,480 Components shipped"); the rolling digits are `aria-hidden`, so a screen reader never hears the intermediate digits.
- Keyboard focus on the host plays the roll.


## Related
Pairs with: Status (hero, pro) — same family, same tokens.
npx shadcn@latest add https://site-supply.vercel.app/r/status.json

## Using Site Supply from an agent

Components are curated, animated site components (buttons, links, cards, badges), each delivered as one self-contained React file: `components/textures/<slug>.tsx`, no Tailwind, no dependency beyond react. Three ways in, in this order:

1. **Copy to Agent** on a Component page (https://site-supply.vercel.app/s/<slug>) hands the user a prompt: the shadcn command, the markdown twin as a fallback, the mount, never recreate. A Pro Component's prompt carries a day-long token in both URLs for an entitled user. Do what the prompt says.
2. **Connected to the Site Supply MCP server** (https://site-supply.vercel.app/mcp): call `search_textures` with the user's words, then `get_texture` with the slug you pick, and write the one file it returns exactly as given.
3. **Neither:** `npx shadcn@latest add https://site-supply.vercel.app/r/<slug>.json` installs a free Component with no setup; or fetch `https://site-supply.vercel.app/s/<slug>.md` (or the page with `Accept: text/markdown`) and write the file under Code exactly. For Pro, send a Site Supply API key from https://site-supply.vercel.app/settings/agents as `Authorization: Bearer <key>` on either URL, or map the registry with the header in `components.json`: `"registries": { "@textures": { "url": "https://site-supply.vercel.app/r/{name}.json", "headers": { "Authorization": "Bearer ${TEXTURES_API_KEY}" } } }` (free Components need no header: `"registries": { "@textures": "https://site-supply.vercel.app/r/{name}.json" }`), then `npx shadcn@latest add @textures/<slug>`.

**A Pro Component without access:** the doors answer with the price (Pro is from $9 a month) and https://site-supply.vercel.app/checkout?texture=<slug>. Tell the user and stop. Never retry, guess or reconstruct the code.

Every published Component is listed at https://site-supply.vercel.app/llms.txt and https://site-supply.vercel.app/r/registry.json. Browse them at https://site-supply.vercel.app/textures.
