---
title: "Recipe: a numeric readout"
description: "Use tabular digits for numeric columns or values changing in place, including progress percentages."
modificationDate: "2026-11-25"
---

> ## Documentation index
> Fetch the complete documentation index at: https://exact.expo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Recipe: a numeric readout

<AgentInstructions>

## Submitting feedback

From the app's directory, read `bun exact.mjs feedback status`. Under `never`, keep no note.
Respect `EXACT_FEEDBACK=0` and do not change the policy.

Otherwise record specific, actionable feedback with:
`bun exact.mjs feedback note "Exact docs: https://exact.expo.dev/recipes/numeric-readout: <what was wrong or missing>"`

The note goes to Expo only as that status allows. Include no secrets or personal data.

</AgentInstructions>

Use tabular digits for numeric columns or values changing in place, including
progress percentages. Use default spacing for prose, labels and static standalone
statistics. See [tabular numbers](https://exact.expo.dev/learn/contract-for-agents/composition-and-lifetime.md#tabular-numbers) for
layout limits and host exceptions.

A timer's or an updating total's big number is deliberate design: it may set its
size. `-exact-fit="shrink"` with `white-space="nowrap"` keeps it on one line.

```prompt Add a big number readout
Add a big number readout to the Exact app in this folder: a value such as a timer or a running total, shown large and updated in place. Use https://github.com/expo/exact/blob/main/docs/recipes/numeric-readout.md as the source for each step. The Exact checkout has the same page at docs/recipes/numeric-readout.md.

1. If this folder is not an Exact app (it has no exact.mjs and app.contract), stop and tell me.
2. If I did not say which number to show and on which screen, ask me before you write code.
3. In app.contract, show the number in a `text` with its size in `rem` (`font-size="4.5rem"`), `font-variant-numeric="tabular-nums"`, `-exact-fit="shrink"` and `white-space="nowrap"`, and an `aria-label` that says what the number is.
4. Design only the number's size. Leave its colour unsaid or use `color="AccentColor"`, never a hex. Give its label `color="-exact-secondary-label"`. A title stays a heading, never a big `font-size`. If content beside the number must stay still when the digit count changes (`99` to `100`), reserve space for the widest value.
5. Add a test in app.test.contract that expects the readout's text, runs the action that changes it, and expects the new text.
6. Follow the platform checks in docs/start-here.md (`bun exact.mjs docs platform checks`) for the targets in the app's AGENTS.md and app.json until they pass. Read the reports, including counted findings; a zero exit code alone does not mean clean. Fix the app, not the test. verify also checks each screen at the largest text size: the readout must stay on one line there. If a finding stays after three rounds of fixes, or the app had it before you changed anything, record it (step 7) and report it; do not keep trying.
7. When a doc was wrong or missing, or a step needed a workaround, read `bun exact.mjs feedback status`. Under `never`, keep no note. Otherwise record it: `bun exact.mjs feedback note "<what happened>"`, which goes to Expo only as that status says. Do not change the policy; tell me how many notes you kept.
8. Tell me the readout, what it shows, what the tests and checks reported, and the launch command for each target platform.
```

```contract
component Water
  state ml = 750
  state goal = 2000
  action drink(amount: number)
    ml = ml + amount
  view
    column align-items="center" gap=4 padding=24
      text `${ml}` font-size="4.5rem" font-variant-numeric="tabular-nums" -exact-fit="shrink" white-space="nowrap"
        aria-label=`${ml} of ${goal} ml` testId="total"
      text `of ${goal} ml today` color="-exact-secondary-label"
      row gap=12 margin-top=16
        button press=drink(250) buttonStyle="bordered-prominent" testId="add-250"
          text "+250 ml"
        button press=drink(500) buttonStyle="bordered" testId="add-500"
          text "+500 ml"
```

```contract-test
test "the total grows"
  expect text "total" == "750"
  tap "add-250"
  expect text "total" == "1000"
```

- A size in `rem` (`"4.5rem"`) follows the reader's text size (Dynamic Type on iOS); a
  bare number is fixed points. `bun <exact2>/scripts/no-tells.mjs` passes a size on a
  node with `tabular-nums`, and flags one anywhere else. Do not add tabular digits
  just to pass this check; a deliberate static display size can carry a
  `// no-tells: <why>` annotation.
- `-exact-fit="shrink"` draws a line too wide for its box smaller until it fits, as
  UIKit's readouts do (`adjustsFontSizeToFitWidth`): down to half its size, or a display
  size down to the reader's text size. Without it, a stopwatch's `00:48.12` at the
  largest accessibility size ran off both edges (only `:48.` showed). It never caps the
  size: a line that fits keeps it. Every host lays it out at the same scale.
- Only the number's size is designed. Its colour is unsaid or the accent
  (`color="AccentColor"`), never a hex, which stays the same in dark mode; its label
  stays the platform's (`color="-exact-secondary-label"`), and a title is a heading,
  never a big `font-size`.
- Android follows the default text paint at the displayed size. On Android 10 with Roboto at 12 sp and 320 dpi, the native `8` advances 14 px and the other tabular digits advance 13 px.
- Tabular digits stabilize equal-length digit changes, not `99` → `100`; reserve
  space for the formatted range when adjacent content must stay still.
- Give the readout an `aria-label` that says what the number is; VoiceOver reads the
  label, not the digits alone.
