Hint
Text with more to say under the pointer: a dotted line under it, and a tooltip with the fuller value or what it means.
<span className="text-body-2 text-neutral-fg"> <Hint tooltip="1,948,935 tokens">1.9M</Hint></span>Installation
import { Hint } from "@dome-systems/ds-dashboard/components";Anatomy
- 1 — Text. Whatever it is given, at the size and in the color of the text around it.
- 2 — Line. Round 1px dots, at least 2px apart, from the text's left edge to its right edge, in the text's color at half strength.
A shortened value
The text is the short form, and the tooltip says the whole of it. The dotted line shows that there is a tooltip.
<span className="text-body-2 text-neutral-fg"> <Hint tooltip="1,948,935 tokens">1.9M</Hint></span>What a word means
The tooltip can also say what the text means, as a table does for a column that needs explaining. This one is the Agents list's cost column.
<span className="text-label-3 text-neutral-fg-secondary"> <Hint tooltip="Estimated from your model rates. Not your provider invoice.">Est. model cost</Hint></span>It takes its text's size and color
The Hint sets no size and no color: it uses the size and color of the text around it. Its line is that text's own color at half strength (--hint-strength, 50%), so it follows any color with nothing to set.
<span className="text-body-3 text-neutral-fg-secondary"> <Hint tooltip="1,948,935 tokens">1.9M</Hint></span><span className="text-body-2 text-neutral-fg"> <Hint tooltip="1,948,935 tokens">1.9M</Hint></span><span className="text-heading-5 text-neutral-fg"> <Hint tooltip="1,948,935 tokens">1.9M</Hint></span><span className="text-body-2 text-error-fg-secondary"> <Hint tooltip="1,948,935 tokens">1.9M</Hint></span><span className="text-body-2 text-link"> <Hint tooltip="1,948,935 tokens">1.9M</Hint></span>Any length
The line starts at the text's left edge and ends at its right edge, whatever the width: the dots stay the same size, and any leftover space is spread evenly between them. Every Hint on a screen today is one line of text. If its text wraps, a Hint still draws a single line of dots, under its last line.
<span className="flex flex-col items-center gap-3 text-body-2 text-neutral-fg"> <Hint tooltip="9 agents are active">9</Hint> <Hint tooltip="1,948,935 tokens">1.9M</Hint> <Hint tooltip="Estimated from your model rates. Not your provider invoice.">Estimated cost of the models an agent called</Hint></span>A hint, cut text, a plain value
Three things that look alike but are different. A Hint has more to say, so it has the line. Text that was only cut is Truncate: it shows the whole text in a tooltip and draws no line. A value that is whole has neither.
<span className="flex items-center gap-8 text-body-2 text-neutral-fg-secondary"> <Hint tooltip="1,948,935 tokens">1.9M</Hint> <Truncate maxWidth={180}>compliance-evidence-collector-production</Truncate> <span>293,764</span></span>Side
The tooltip opens above the text. side puts it elsewhere.
<span className="flex items-center gap-8 text-body-2 text-neutral-fg"> <Hint tooltip="1,948,935 tokens">1.9M</Hint> <Hint tooltip="1,948,935 tokens" side="right">1.9M</Hint> <Hint tooltip="1,948,935 tokens" side="bottom">1.9M</Hint></span>Without a tab stop
A Hint is a tab stop, so the keyboard reaches the tooltip. focusable={false} removes it. Use this where a screen reader can already read the full value in the page, and a tab stop on every value would be too many. The Table does this in its cells: the short form is hidden from a screen reader, which is given the full value in its place.
<span className="text-body-2 text-neutral-fg-secondary"> <Hint tooltip="1,948,935 tokens" focusable={false}> <span aria-hidden>1.9M</span> <span className="sr-only">1,948,935 tokens</span> </Hint></span>The line only under the pointer
--hint-line is the line's opacity, 1 unless set. To show the line only some of the time, for example on hover, set it to 0, then to 1 when it should show. The Table does it on a row: a row's lines show while the pointer is on it.
<span className="flex items-center gap-6 rounded-[8px] px-3 py-2 text-body-2 text-neutral-fg-secondary [--hint-line:0] hover:bg-(--neutral-bg-muted) hover:[--hint-line:1]"> billing-reconciler <Hint tooltip="1,948,935 tokens" focusable={false}> 1.9M </Hint></span>In the dashboard
Where the dashboard shows a Hint today. Both are inside the Table, which draws them itself. The pictures show the line; on a screen it appears only at the moments each card says.
A shortened number in a table
The Table's short form of a count or a cost, with the whole value in the tooltip. The line shows with its row: under the pointer, on keyboard focus, while the row's menu is open, and always on a touch screen. The Agents list draws its counts and its cost this way.
ds/components/table/cell.tsx (TableShort), components/agents/agent-table.tsx
A column that says what it means
A table's header whose column has a help text: while the header shows its label, the label is the Hint, and its line shows under the pointer. A header narrowed to its icon has a plain tooltip and no line. The Agents list's cost column is the one with a help text.
ds/components/table/data-table.tsx, components/agents/agent-table.tsx
Accessibility
A Hint is a <span> around its text, with the ds Tooltip on it. It is a tab stop unless focusable is off, and it shows a focus ring when the keyboard reaches it. The tooltip is the Tooltip's own: see its page for when it opens and closes.
The dotted line is decoration: a screen reader is told nothing by it. What a screen reader says for a Hint, and whether it reads the tooltip, was not tested.
The cursor over a Hint is the plain arrow. It is never the question-mark cursor.
API Reference
Hint
Besides these, the props of a <span>.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | The text the line goes under. |
tooltip | ReactNode | — | What the tooltip says: the fuller value, or what the value means. |
side | "top" | "right" | "bottom" | "left" | "inline-start" | "inline-end" | "top" | Which side of the text the tooltip opens on. |
focusable | boolean | true | A tab stop, so the keyboard reaches the tooltip. |
delay | number | 0 | How long the pointer rests before the tooltip shows, in ms. A table's shortened number waits 200ms, as cut text does. |
hintClassName
The dotted line alone, as a class name, imported beside Hint. It is for an element that already has its own tooltip. No screen uses it by itself today.
Tokens
In ds/tokens/hint.css. The line is drawn, never the browser's dotted underline, whose dots change shape and spacing with the font and the zoom.
| Token | Value | What it sets |
|---|---|---|
--hint-dot | 1px | A dot's size. |
--hint-dots | one round dot | The dot's shape, as a picture the line repeats. |
--hint-gap | 2px | The gap after a dot, at least: what the width leaves over is shared between the gaps. |
--hint-offset | 1px | From the bottom of the text's line up to the dots: about 3px under the baseline at 13px. |
--hint-strength | 50% | How much of the text's color the line takes. |
--hint-line | 1 | The line's opacity. Not set in the file: set it to 0, then to 1 when the line should show. |
Rules
Written down
Dotted means there is more under the pointer
A solid underline is a link's. A dotted one says there is more to read under the pointer.
From ds/components/hint.tsx.
The line is half its text's color
--hint-strength is 50%, under any text. The designer tried it from 30% to 80% under primary gray, secondary gray, red and link text, and kept 50%.
From ds/tokens/hint.css and ds/README.md (Hint).
Not for text that was only cut
A Hint's tooltip says something its text does not. Text that is the same words, cut short, is Truncate.
From ds/components/hint.tsx.
Under text, never under an icon
An icon with a tooltip keeps its tooltip and gets no dotted line.
From ds/components/hint.tsx and ds/README.md (Hint).
The cursor is never the question mark
Over a Hint the cursor is the plain arrow.
From ds/components/hint.tsx and .claude/rules/dashboard-ui.md (T8).
In a table, only under a shortened number, and only while its row is hovered
A relative time, a whole number and a date read as they are: they get no tooltip and no line. The Table also shows a row's lines when the keyboard is in the row, while the row's menu is open, and on a touch screen, where nothing hovers.
From .claude/rules/dashboard-ui.md (T8).
Open questions
Does a column's help get the dotted line?
OpenThe table rule puts the dotted line only under a shortened number. The Table also draws it under a header whose column has a help text, while the pointer is on the header. Nothing written settles which is meant.
Not looked up.
What should a Hint do on more than one line?
OpenToday it draws one line of dots, under its last line. No screen wraps a Hint.
Not looked up.