Content
One line. A tooltip that wraps should have been a popover.
14 minutes ago
Soil moisture at 300 mm · 42.1%
Shows a short label or an exact value next to the thing it describes.
Change the position to turn the arrow, and the tone to suit the surface underneath.
<WildTooltip
text="14 minutes ago"
position="top"
/>Two, with the same size and arrow, so switching tone never moves the bubble.
<WildTooltip text="14 minutes ago" />
<WildTooltip text="14 minutes ago" tone="light" />Four. The position is the side of the trigger the bubble sits on, and the arrow points back at it.
<WildTooltip text="Last reading 14 minutes ago" position="top">
<WildIconButton icon="info" />
</WildTooltip>One line. A tooltip that wraps should have been a popover.
Show it on keyboard focus as well as hover, and point the trigger’s aria-describedby at it. A screen reader then reads it after the trigger’s name.
| Key | What it does |
|---|---|
| Tab | Focusing the trigger shows the tooltip. |
| Escape | Hides it, and focus stays on the trigger. |
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | — | The one line it shows. |
| position | 'top' | 'bottom' | 'left' | 'right' | 'top' | Which side of the trigger it sits. |
| tone | 'dark' | 'light' | 'dark' | See Tones. |
| Token | Value | Where it lands |
|---|---|---|
| --global-neutral-grey-1300 | #0A090B | Dark ground. |
| --color-white | #FFFFFF | Dark text; light ground. |
| --global-neutral-grey-1100 | #2D2B32 | Light text. |
| --global-neutral-grey-600 | #DCDCDE | Light border and arrow edges. |
| --shadow-dropdown | 0 4px 12px rgba(0,0,0,.08), … | Both tones. |
| --radius-xs | 3px | Corner. |
| (no token) | 10px / 14px, 500 | Text size, line height and weight. |