Components
Tooltip
Tooltip
A small label that appears on hover or keyboard focus. Pure CSS, no JavaScript and no dependencies, so it works in live and dead views.
On hover or focus
A label on hover or keyboard focus. Pure CSS - no JS, no dependencies - and the bubble inverts against the page in both colour schemes. placement puts it top, bottom, left or right; arrow adds the pointer.
Copied to clipboard
<.tooltip label="Copied to clipboard">
<.button color="gray" variant="outline">Hover me</.button>
</.tooltip>
Icon buttons
The classic use: a glyph gets its name on hover while aria-label carries it for screen readers - the tooltip is a sighted-user convenience, not the accessible name.
Rich content
The :content slot takes markup when one line isn't enough - keep it glanceable; a tooltip is still a label, not a panel. For interactive content reach for popover instead.
Locked
Deploys locked
ask in #releases to unlock
ask in #releases to unlock
<.tooltip placement="bottom">
<:content>
<span class="font-semibold">Deploys locked</span><br />ask in #releases to unlock
</:content>
<.badge color="warning" label="Locked" />
</.tooltip>
Properties
| Attribute | Type | Default | Description |
|---|---|---|---|
arrow
|
boolean |
true
|
show the arrow pointing at the trigger |
class
|
any |
nil
|
extra classes for the wrapper |
content_class
|
any |
nil
|
extra classes for the tooltip bubble |
disabled
|
boolean |
false
|
when true, no tooltip is rendered |
id
|
string |
id for the tooltip bubble; autogenerated if not set | |
label
|
string |
nil
|
the tooltip text (or use the :content slot) |
placement
|
string |
"top"
|
which side of the trigger the tooltip appears on
one of: "top", "bottom", "left", "right"
|
rest
|
global |
||
:content
slot
|
slot |
rich tooltip content; overrides the label attr | |
:inner_block
slot
|
slot |
the trigger content |