Skip to content

No.172 · AI & Chat· New

Confidence Ink

Generated text printed with the model's own certainty. Words it was unsure of come out in lighter ink with a dotted underline; open one to see what else it nearly wrote, with the odds, and swap it in. A slider sets how unsure counts as unsure.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Light

Build a reader for model output that shows token confidence. Input is a list of tokens { text, p, alternatives?: { text, p }[] } that join into the answer (here: when the Muttrah souq in Muscat opens). Layout: a warm off-white 14px-radius panel. Header: a small uppercase label and a range slider 'Mark words below 60%' (20–95%). Body: the answer in Newsreader at 20px/1.65. Tokens under the threshold render as inline buttons: the ink fades with the probability (never below half strength, via color-mix), with a 2px dotted violet underline. Hovering or opening one tints it. Opening shows a 15rem menu under the word, clamped inside the panel: 'The model weighed', then every option (the current word ticked) with its percentage and a faint bar behind it as wide as its probability. Picking one swaps it in; the swapped word turns green on a green wash (a short flash as it lands) and the old word stays in the menu, marked 'original', so it can be undone. Footer: '6 words below 60% · 1 changed by you' and a key showing 'unsure' and 'changed'. Selected variant — Light (light): Palette for this theme (Light): --cink-bar rgb(107 91 210 / 0.14); --cink-bg #faf8f3; --cink-edit #1d7a5a; --cink-edit-bg rgb(29 122 90 / 0.1); --cink-focus #6b5bd2; --cink-ink #1f1d1a; --cink-line rgb(31 29 26 / 0.1); --cink-low #6b5bd2; --cink-menu #ffffff; --cink-muted #75706a; --cink-paper #fffdf8. Treat these as the root colour tokens, one value per role, and name them to suit your code. Select it with the theme option set to "light". Keep every dimension, spacing value, state and motion from the brief unchanged, and keep text at 4.5:1 contrast or better on these surfaces. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Tab reaches only the marked words. Enter or click opens the menu; ↑/↓, Home and End move through options, Enter picks, Escape or Tab closes and returns focus to the word. A click outside closes. Dragging the slider remarks the text live. Motion: The menu fades down 4px on open; a swapped word flashes green once. Both are removed with reduced motion. Accessibility: Marked words are buttons with aria-haspopup=menu and labels that speak the probability ('8:30, 34% likely, 3 other choices'). Options are menuitemradio with aria-checked. Swaps are announced politely. Lighter ink never drops below readable contrast; the dotted underline carries the meaning without colour. Responsive behavior: Text steps down to 18px and the panel padding tightens below 520px; the menu stays clamped inside the panel. Touch: Tap a word to open its choices and tap one to swap. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Tab reaches only the marked words. Enter or click opens the menu; ↑/↓, Home and End move through options, Enter picks, Escape or Tab closes and returns focus to the word. A click outside closes. Dragging the slider remarks the text live.
Motion
The menu fades down 4px on open; a swapped word flashes green once. Both are removed with reduced motion.
Accessibility
Marked words are buttons with aria-haspopup=menu and labels that speak the probability ('8:30, 34% likely, 3 other choices'). Options are menuitemradio with aria-checked. Swaps are announced politely. Lighter ink never drops below readable contrast; the dotted underline carries the meaning without colour.
Responsive
Text steps down to 18px and the panel padding tightens below 520px; the menu stays clamped inside the panel.
On touch
Tap a word to open its choices and tap one to swap.

Featured

363 components