Kinetic Tooltip

A short hint that appears on hover and keyboard focus, flips to stay on screen and can be dismissed with Escape.

  • <kt-kinetic-tooltip>
  • Overlays
  • No framework

Kinetic Tooltip

Rate limitCtrl KBilling cycle

The code

Copy the Kinetic Tooltip

Fastest: press Copy on the card above for one complete file. To build it into your own project, use the files below: the markup, the styles, this component’s script and the shared effects script (effects.js) that every component uses.

<kt-kinetic-tooltip text="Requests are limited to 600 per minute per API key." placement="top">Rate limit</kt-kinetic-tooltip>

<kt-kinetic-tooltip text="Open the command palette" placement="bottom"><kbd>Ctrl K</kbd></kt-kinetic-tooltip>

<kt-kinetic-tooltip text="Billing is charged in UTC on the first of the month." placement="right">Billing cycle</kt-kinetic-tooltip>

Attributes

NameWhat it doesDefault
textThe hint shown in the tooltip.—
placement"top", "bottom", "left", "right" or "auto". It flips to the other side when there is no room.top
delayMilliseconds to wait before showing it on hover.220

Keyboard and screen readers

  • The bubble is role="tooltip" and the trigger points to it with aria-describedby.
  • It shows on keyboard focus as well as on hover; plain text becomes focusable so keyboard users can reach it.
  • Escape hides it without moving focus.
  • The bubble stays open while the pointer is over it, so it can be read and selected.

Styling variables

Every look is a CSS variable: --kt-accent, --kt-accent-ink, --kt-radius-btn, --kt-surface-radius, --kt-surface-bg, --kt-border-w, --kt-comp-shadow and --font-sans. The copied file sets them all from your choices.

FAQ

Kinetic Tooltip: questions answered

How do I use the Kinetic Tooltip?

Press Copy on the card to get a complete HTML file, or copy the HTML, CSS and JavaScript tabs into your own page. In your markup the element is written as <kt-kinetic-tooltip>.

Which attributes does <kt-kinetic-tooltip> accept?

text, placement, delay. Each one is described in the attributes table on this page.

Is the Kinetic Tooltip accessible?

The bubble is role="tooltip" and the trigger points to it with aria-describedby. It shows on keyboard focus as well as on hover; plain text becomes focusable so keyboard users can reach it. Escape hides it without moving focus. The bubble stays open while the pointer is over it, so it can be read and selected.

Can I change the Kinetic Tooltip colors, corners and font?

Yes. Use the options on this page: accent color, border radius, background, border, shadow and Google font. The copied code already contains your choices, and every one of them is a CSS variable you can edit later.