Menu
Feedback

Tooltip

A short label that appears on hover or focus. One attribute, no JavaScript.

NameTypeWhat it does
data-tip="…"componentAttribute: the text to show above the element

Put it on something that can take focus, so keyboard and touch users can reach it. Screen readers do not reliably read text drawn by CSS: load behaviors.js and it copies the tip into the element's accessible name or description, and lets Escape dismiss it. Without the script, add aria-label yourself.

Tooltip

<button class="btn" data-tip="Copies the share link">Hover or focus me</button>