Tooltip
A short description of the control it wraps, shown on hover and focus after a moment.
Stability: experimental
Props
| Prop | Type | Default | Means |
|---|---|---|---|
text | string | The description, a few words long. | |
placement | "top" | "bottom" | "left" | "right" | top | Which side of the control it prefers. It flips to the opposite side when there is no room. |
Children
The control it describes, such as an IconButton.
States
| State | Looks like |
|---|---|
hidden | Not shown; the control is still described by the text. |
shown | Caption text in the surface colour on an ink background, a small radius, 6px from the control; fades in over 120 ms (at once with reduced motion). |
Accessibility
| role | tooltip |
| name | Its text. |
| focus | Never takes focus. It shows 500 ms after the control is hovered or focused, and hides when the pointer or focus leaves. |
| keyboard | Escape hides it, leaving focus where it is. |
| notes | The control is described by the tooltip (aria-describedby) whether it shows or not, so its text is never lost to a screen reader. |
Theme tokens
color.ink color.surface shadow.md radius.sm space.1 space.2 text.caption
Example
<Tooltip text="Add to favourites"><IconButton icon="star" label="Favourite" /></Tooltip>