Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsMay 28, 2026·2 min de lectura

Tippy.js — Tooltip and Popover Library for the Web

A highly customizable tooltip, popover, and dropdown library built on top of Popper.js (now Floating UI) with animation and theming support.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Tippy.js Overview
Comando de instalación directa
npx -y tokrepo@latest install 72668f7c-5a2a-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

Tippy.js is a tooltip and popover positioning library that wraps Popper.js (now Floating UI) with a declarative API. It handles placement, flipping, animations, and interactivity out of the box, making it straightforward to add polished tooltips, menus, and dropdowns to any web application.

What Tippy.js Does

  • Renders tooltips, popovers, dropdowns, and context menus with smart positioning
  • Handles viewport boundary detection and automatic flipping
  • Supports HTML content, interactive elements, and nested tippys
  • Provides multiple animation styles and custom transition hooks
  • Offers a headless mode for unstyled, fully custom rendering

Architecture Overview

Tippy.js creates a wrapper element for each tooltip instance and delegates positioning to Popper.js. The library manages show/hide lifecycle, event listeners, and animation states through an internal state machine. Each instance can be independently configured, updated, or destroyed without affecting others.

Self-Hosting & Configuration

  • Install via npm or load from a CDN with the default CSS theme
  • Initialize with tippy(selector, options) passing a CSS selector or DOM element
  • Set placement, trigger, delay, animation, and theme in the options object
  • Use tippy.setDefaultProps() to configure global defaults
  • Import additional CSS files for built-in themes like light, material, or translucent

Key Features

  • Automatic repositioning when scrolling or resizing the viewport
  • Touch device support with configurable touch and hold behavior
  • Singleton mode to reuse one tooltip instance across multiple targets
  • Event delegation for dynamically added elements
  • Accessibility attributes added automatically (aria-describedby, role)

Comparison with Similar Tools

  • Floating UI — Lower-level positioning primitive; Tippy.js adds the UI layer on top
  • Bootstrap Tooltips — Tied to Bootstrap; Tippy.js is framework-agnostic with richer features
  • React Tooltip — React-specific; Tippy.js works with vanilla JS and has a React wrapper (@tippyjs/react)
  • Popper.js — Positioning engine only; Tippy.js adds rendering, animations, and lifecycle management

FAQ

Q: Does Tippy.js work with React? A: Yes. Use the official @tippyjs/react package for a component-based API.

Q: Can I put interactive content like buttons inside a tooltip? A: Yes. Set interactive: true to allow users to hover into and interact with the tooltip content.

Q: What is headless mode? A: Headless mode provides positioning logic without any default styles, letting you render completely custom tooltip UI.

Q: How do I handle tooltips on dynamically created elements? A: Use the delegate() add-on to attach tooltips via event delegation on a parent container.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados