A tooltip shows supplemental information related to a specific UI element. The tooltip displays when a user hovers, places focus, or taps on the corresponding UI element.
<div class="luci-tooltip">
<div class="luci-tooltip__trigger">
<svg class="luci-icon" aria-hidden="true">
<use xlink:href="/icons/luci.svg#help"> </use>
</svg>
</div>
<div class="luci-tooltip__content">
<div class="luci-tooltip__content-inner">
<div class="luci-tooltip__text"> This is a default tooltip on an icon. </div>
</div>
</div>
</div>
<div class="luci-tooltip luci-tooltip--hidden-on-hover">
<div class="luci-tooltip__trigger">
<svg class="luci-icon" aria-hidden="true">
<use xlink:href="/icons/luci.svg#help"> </use>
</svg>
</div>
<div class="luci-tooltip__content">
<div class="luci-tooltip__content-inner">
<div class="luci-tooltip__text"> This is a default tooltip on an icon triggerd on click only. </div>
</div>
</div>
</div>
alt
text that describes the tooltip content for screen readers.role=tooltip aria-describedby
attribute to associate itself with the tooltip.Class | Applies to | Outcome |
---|---|---|
|
Any |
Adds the tooltip container class. |
|
Any |
Adds the tooltip trigger behavior. |
|
|
Positions the tooltip above the trigger element and aligned to the left. |
|
|
Positions the tooltip above the trigger element and aligned to the right. |
|
|
Positions the tooltip below and the trigger element and aligned to the center. |
|
|
Positions the tooltip below the trigger element and aligned to the left. |
|
|
Positions the tooltip below the trigger element and aligned to the right. |
|
|
Positions the tooltip to the left of the trigger element and aligned to the center. |
|
|
Positions the tooltip to the left of the trigger element and aligned to the bottom. |
|
|
Positions the tooltip to the left of the trigger element and aligned to the top. |
|
|
Positions the tooltip to the right of the trigger element and aligned to the center. |
|
|
Positions the tooltip to the right of the trigger element and aligned to the bottom. |
|
|
Positions the tooltip to the right of the trigger element and aligned to the top. |
|
|
Applies visibility property to tooltip. |
|
|
Removes the "appear on hover" behavior and only allows the tooltip to be shown on click. |