Components/Overlay

Tooltip

Tooltips are short hints anchored to a control, shown when the reader hovers over it or moves focus to it. They carry a clarification the interface has no room to state outright, which means they can only ever hold something the reader could manage without.

import { Tooltip } from '@growth-protocol-ai/alpha';

On this page

variant
side
state
Tooltip.tsxtsx
1import { Tooltip } from '@growth-protocol-ai/alpha';
2
3<Tooltip
4 variant="regular"
5 side="top"
6 label="Copy link"
7 open={false}
8 onOpenChange={setOpen}
9>
10 <Button variant="outlined" iconOnly aria-label="Copy link">
11 <CopyIcon />
12 </Button>
13</Tooltip>

When to use

Reach for a tooltip when a control cannot say what it does in the room it has — a button carrying nothing but a glyph, a heading truncated to fit its column, an abbreviation the reader may not know. The hint arrives the moment the pointer or the focus ring lands, with no delay to wait through, so finding out costs nothing; what it must never cost is the information itself, because a reader who does not go looking never sees it.

When not to use

A tooltip is not a place to keep anything. It does not appear on a touch screen, it is gone the moment the trigger loses the pointer, and a reader searching the page will not turn it up — so what someone would be stuck without belongs on the page instead. When the content has to be read or acted on rather than glanced at, that is a Modal, which takes the page and waits until it is dealt with; when there is something inside it to click, it is a Dropdown, because a tooltip never takes the pointer and a link in one can never be reached.

variant3 values

One geometry, three fills, and the arrow is retinted by the same declaration as the body. The regular chip is a dark fill with light text in both themes, which is what makes it read as a layer over the page rather than a panel in it. What picks a different fill is the surface the hint lands on, not the theme; the other two are for the cases where inverting works against you. Nothing below is on screen until it is asked for, so hover a trigger, or tab into the row and watch the hint follow the focus ring.

regular
inverted
additional
variantWhen to use
regularThe default, and the answer unless the surface underneath has already taken this colour.
invertedThe opposite fill: light in a light theme, near-white in a dark one. For a hint on a dark card or over a modal backdrop, where the regular chip is the colour of what it is sitting on.
additionalA mid grey, quieter than either. For secondary context beside a hint that matters more — not for a hint that matters less than the page.

side4 values

Side is where the tooltip sits, which is what every positioning library means by it and the opposite of how the Figma variants are named — those name the direction the arrow points, so Up is the tooltip below its trigger and Down is the one above. Either way it is a preference rather than a guarantee: a trigger with no room on the side you asked for flips to the opposite one, and the arrow goes with it, which the specimens will do if you narrow the window while one is up.

top
right
bottom
left
sideWhen to use
topAbove the trigger. The default, and the one that stays out of the way of whatever the control acts on.
rightTo the right. The collapsed-sidebar hint — a rail of glyphs naming themselves without moving the column.
bottomBelow the trigger. For a toolbar along the top of a screen, where above is off the edge.
leftTo the left. For a control in a right rail, for the same reason.