InstallComponentsExample

Tooltip

A short hint on hover or keyboard focus, set with data-tooltip.

How it helpsPure CSS and one attribute. It also appears on keyboard focus, not only hover.

Positions

SIP
export default function Example() {
  return (
    <>
      <button data-variant="ghost" data-tooltip="Saved 2 min ago">Hover me</button>
      <button data-variant="ghost" data-tooltip="Below the button" data-tooltip-pos="bottom">Bottom</button>
      <span className="badge" data-tooltip="Systematic Investment Plan" tabIndex={0}>SIP</span>
    </>
  );
}
<button data-variant="ghost" data-tooltip="Saved 2 min ago">Hover me</button>
<button data-variant="ghost" data-tooltip="Below the button" data-tooltip-pos="bottom">Bottom</button>
<span class="badge" data-tooltip="Systematic Investment Plan" tabindex="0">SIP</span>

API

NameTypeDescription
data-tooltip="text"attrTooltip text.
data-tooltip-pos="bottom"attrShow below (default is above).