s72
  • Tooltip

    data-tip

    data-tip="Text" on any element shows a short label above it on hover and on keyboard focus. Keep it to a few words: it is drawn as one line that does not wrap.

    Basic

    html
    <p style="display:flex;gap:.75rem;flex-wrap:wrap">
      <button data-variant="line" data-tip="Copies the build command">Copy</button>
      <button data-variant="ghost" data-tip="Keyboard: ⌘ K">Commands</button>
    </p>

    The tip appears on :focus-visible as well as on hover, so it is reachable from the keyboard.

    Notes