Tooltip
Shows a short label or explanation when people hover over or focus an element.
Default
A small tooltip shows its
title
.
3 hours ago
Oct 20, 2026 at 14:32 UTC
<.tooltip id="tooltip-default" title="Oct 20, 2026 at 14:32 UTC">
<:trigger :let={attrs}>
<span tabindex="0" {attrs}>3 hours ago</span>
</:trigger>
</.tooltip>
Large
A large tooltip adds a
description
and an optional icon.
Cache hit rate
The share of cacheable targets that were downloaded from the cache instead of built.
<.tooltip
id="tooltip-large"
size="large"
title="Cache hit rate"
description="The share of cacheable targets that were downloaded from the cache instead of built."
>
<:trigger :let={attrs}>
<.button icon_only variant="secondary" size="small" aria-label="About cache hit rate" {attrs}>
<.info_circle />
</.button>
</:trigger>
<:icon><.database /></:icon>
</.tooltip>
Placement
Tooltips open below the trigger, aligned to its start, by default.
placement
moves them.
Opens above
Opens below, centered
Opens below, aligned to the start
<.tooltip id="tooltip-placement-top" title="Opens above" placement="top">
<:trigger :let={attrs}>
<.button label="Top" variant="secondary" {attrs} />
</:trigger>
</.tooltip>
<.tooltip id="tooltip-placement-bottom" title="Opens below, centered" placement="bottom">
<:trigger :let={attrs}>
<.button label="Bottom" variant="secondary" {attrs} />
</:trigger>
</.tooltip>
<.tooltip id="tooltip-placement-bottom-start" title="Opens below, aligned to the start">
<:trigger :let={attrs}>
<.button label="Bottom start" variant="secondary" {attrs} />
</:trigger>
</.tooltip>
On a badge
Explains a status without taking up space in a table or header.
Partial
Partial coverage
Some targets came from the binary cache without coverage counters, so their coverage is unknown.
<.tooltip
id="tooltip-badge"
size="large"
title="Partial coverage"
description="Some targets came from the binary cache without coverage counters, so their coverage is unknown."
>
<:trigger :let={attrs}>
<span tabindex="0" {attrs}>
<.badge label="Partial" color="warning" style="light-fill" />
</span>
</:trigger>
</.tooltip>
Guidelines
- Use a tooltip for supplementary information, such as the exact date behind a relative time or what a metric means. Never put the only way to understand or complete a task in a tooltip.
-
Spread the attributes from the
:triggerslot onto the element:<:trigger :let={attrs}>and then{attrs}on it. Use a focusable trigger, such as a button, or addtabindex="0", so keyboard users can open it. -
Give icon-only triggers an
aria-labelthat says what the tooltip explains. -
Small tooltips show only the
title. Usesize="large"with adescriptionfor a sentence or two of explanation, and the:iconslot to add an icon. - Tooltips open after a short delay and stay open while the pointer moves onto them. On touch screens, a tap on the trigger toggles the tooltip.
- For content people need to click, such as a copy button, use a popover instead.
API reference
<.tooltip>
| Attribute | Type | Default | Description |
|---|---|---|---|
|
description
|
string
|
–
|
Tooltip description. Only shown when
size
is set to large.
|
|
disabled
|
boolean
|
false
|
|
|
id
Required
|
string
|
–
|
|
|
placement
|
string
|
"bottom-start"
|
Positioning placement of the tooltip (e.g. "bottom", "bottom-start", "top")
|
|
size
|
string
|
"small"
|
Size of the tooltip
"small""large"
|
|
title
Required
|
string
|
–
|
Tooltip title
|
| Slot | Description |
|---|---|
|
:icon
|
Icon to be rendered inside the tooltip. Only shown when
size
is set to large.
|
|
inner_block
|
Content to be rendered inside the tooltip
|
|
:trigger
Required
|
Tooltip trigger
|