On this page

InstallationAnatomyA shortened valueWhat a word meansIt takes its text's size and colorAny lengthA hint, cut text, a plain valueSideWithout a tab stopThe line only under the pointerIn the dashboardAccessibilityAPI ReferenceHinthintClassNameTokensRulesWritten downOpen questions

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.

1.9M
1<span className="text-body-2 text-neutral-fg">2  <Hint tooltip="1,948,935 tokens">1.9M</Hint>3</span>

Installation

import { Hint } from "@catalog-developer/components";

Anatomy

1.9M12
  1. 1 — Text. Whatever it is given, at the size and in the color of the text around it.
  2. 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.

1.9M
1<span className="text-body-2 text-neutral-fg">2  <Hint tooltip="1,948,935 tokens">1.9M</Hint>3</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.

Est. model cost
1<span className="text-label-3 text-neutral-fg-secondary">2  <Hint tooltip="Estimated from your model rates. Not your provider invoice.">Est. model cost</Hint>3</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.

1.9M1.9M1.9M1.9M1.9M
1<span className="text-body-3 text-neutral-fg-secondary">2  <Hint tooltip="1,948,935 tokens">1.9M</Hint>3</span>4<span className="text-body-2 text-neutral-fg">5  <Hint tooltip="1,948,935 tokens">1.9M</Hint>6</span>7<span className="text-heading-5 text-neutral-fg">8  <Hint tooltip="1,948,935 tokens">1.9M</Hint>9</span>10<span className="text-body-2 text-error-fg-secondary">11  <Hint tooltip="1,948,935 tokens">1.9M</Hint>12</span>13<span className="text-body-2 text-link">14  <Hint tooltip="1,948,935 tokens">1.9M</Hint>15</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.

91.9MEstimated cost of the models an agent called
1<span className="flex flex-col items-center gap-3 text-body-2 text-neutral-fg">2  <Hint tooltip="9 agents are active">9</Hint>3  <Hint tooltip="1,948,935 tokens">1.9M</Hint>4  <Hint tooltip="Estimated from your model rates. Not your provider invoice.">Estimated cost of the models an agent called</Hint>5</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.

1.9Mcompliance-evidence-collector-production293,764
1<span className="flex items-center gap-8 text-body-2 text-neutral-fg-secondary">2  <Hint tooltip="1,948,935 tokens">1.9M</Hint>3  <Truncate maxWidth={180}>compliance-evidence-collector-production</Truncate>4  <span>293,764</span>5</span>

Side

The tooltip opens above the text. side puts it elsewhere.

1.9M1.9M1.9M
1<span className="flex items-center gap-8 text-body-2 text-neutral-fg">2  <Hint tooltip="1,948,935 tokens">1.9M</Hint>3  <Hint tooltip="1,948,935 tokens" side="right">1.9M</Hint>4  <Hint tooltip="1,948,935 tokens" side="bottom">1.9M</Hint>5</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.

1.9M1,948,935 tokens
1<span className="text-body-2 text-neutral-fg-secondary">2  <Hint tooltip="1,948,935 tokens" focusable={false}>3    <span aria-hidden>1.9M</span>4    <span className="sr-only">1,948,935 tokens</span>5  </Hint>6</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.

billing-reconciler1.9M
1<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]">2  billing-reconciler3  <Hint tooltip="1,948,935 tokens" focusable={false}>4    1.9M5  </Hint>6</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.

1.9M

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

Est. model cost

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>.

PropTypeDefaultDescription
childrenReactNode—The text the line goes under.
tooltipReactNode—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.
focusablebooleantrueA tab stop, so the keyboard reaches the tooltip.
delaynumber0How 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.

TokenValueWhat it sets
--hint-dot1pxA dot's size.
--hint-dotsone round dotThe dot's shape, as a picture the line repeats.
--hint-gap2pxThe gap after a dot, at least: what the width leaves over is shared between the gaps.
--hint-offset1pxFrom the bottom of the text's line up to the dots: about 3px under the baseline at 13px.
--hint-strength50%How much of the text's color the line takes.
--hint-line1The 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).

compliance-evidence-collector
DoCut text is Truncate: the whole text in a tooltip, and no line.
compliance-evid…
Don’tThe line promises something new, but the tooltip only shows the rest of the same text.

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?

Open
Ours

The 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.

Other systems

Not looked up.

What should a Hint do on more than one line?

Open
Ours

Today it draws one line of dots, under its last line. No screen wraps a Hint.

Other systems

Not looked up.

Catalog
Foundations
  • Overview
  • Components
  • Tokens
  • Token usage
  • Typography
  • Icons
Atoms
  • Avatar
  • Badge
  • Button
  • Checkbox
  • Color picker
  • Copy button
  • Icon tooltip
  • Inline code
  • Input
  • Hint
  • Kbd
  • Loader
  • Native select
  • Progress bar
  • Progress ring
  • Radio
  • Select
  • Status dot
  • Switch
  • Text link
  • Textarea
  • Tooltip
  • Truncate
Molecules
  • Accordion
  • Activity chart
  • AI elements
  • Alert
  • Button group
  • Card
  • Code block
  • Combobox trigger
  • Command
  • Content table
  • Context switcher
  • Dropdown menu
  • Empty state
  • Field
  • Field group
  • Filter chip
  • Flow
  • Heading
  • Icon picker
  • Icon flow card
  • Metric card
  • Modal
  • Modal confirmation
  • Pagination
  • Popover
  • Scroll area
  • Sidebar
  • Table
  • Tabs
  • Toggle group
LibraryPublished release