MeDo

Generador de Tooltips con IA.

Describe la pista que necesitas y MeDo genera todo el comportamiento — retardos de apertura y cierre, volteo para alejarse de los bordes del viewport, una flecha que sigue apuntando al disparador, activación por foco de teclado y el cableado de aria-describedby.

Tooltip
Tooltip

El tooltip es el único componente que un tercio de tus usuarios nunca verá

El hover no existe en una pantalla táctil. No hay ningún gesto en el móvil que signifique de forma fiable "muéstrame la descripción sin activar este control", lo que significa que todo tooltip es invisible para una parte importante de tu tráfico. Ese solo hecho resuelve la mayoría de las discusiones de diseño sobre tooltips antes de empezar: un tooltip solo puede llevar información que el usuario no necesita. Los requisitos de un campo, los mensajes de error, las condiciones de precio y el significado de un botón con solo icono tienen que estar en algún lugar visible o en un nombre accesible. Trata el tooltip como un refinamiento sobre una interfaz que ya funciona sin él, y las preguntas de accesibilidad se responden casi solas.

6 plantillas

Plantillas de Tooltip que puedes generar

Cada plantilla es un prompt real, no una captura de pantalla. Cópialo en cualquier editor de IA o ejecútalo en MeDo y obtén código React + Tailwind.

BasicLabel Hint

Dark Panel Hint on Hover and Focus

The default tooltip: one line of plain text, dark panel, arrow, delays in both directions. Reach for it when a control is already named and you only want to add a detail a mouse user might appreciate.

Create a tooltip component that wraps a single trigger child and renders a short plain-text hint on pointer enter and on focus-visible. Use a dark slate panel with 13px white text, 6px vertical and 10px horizontal padding, a 6px radius, a 240px max width and an 8px offset from the trigger, plus a 6px arrow aimed at the trigger. Open after a 300ms delay and close after 100ms so the pointer can cross the gap without the panel vanishing. Dismiss on Escape, on blur and on scroll. Give the panel role="tooltip" and link it to the trigger with aria-describedby only while it is open, rather than leaving hidden markup in the tree. Fade and translate 4px on entry, and drop the transition entirely under prefers-reduced-motion.

Prueba en MeDo
Icon-onlyIcon Button

Tooltip as the Only Label a Control Has

When the icon is the whole button, the tooltip text is the accessible name — not a description. Getting that distinction wrong is why so many toolbars announce the same word twice.

Create a tooltip for an icon-only button where the tooltip text is the only name the control has. Put that string in aria-label on the button and do not also set aria-describedby, so the same words are not announced twice. The visible panel exists for sighted pointer users: dark surface, 12px text, a single line that does not wrap under 200px. Open on hover after a 400ms delay but open immediately on focus-visible, since a keyboard user has already committed to the control. Close on Escape, on blur and on pointer leave. Keep the button hit area at least 44px even when the glyph is 20px, and skip rendering the panel entirely when a coarse pointer is detected.

Prueba en MeDo
CollisionAuto Flip

Edge-Aware Placement With a Tracking Arrow

Handles the case a fixed side always breaks: a trigger near the top of a scroll container or the right edge of the viewport. The arrow has to re-anchor after the flip or it points at nothing.

Create a tooltip with collision-aware placement: a preferred side prop of top, bottom, left or right, an explicit fallback order, and shifting along the cross axis when the panel would overflow the viewport or the nearest scrolling ancestor. Add a 6px arrow that re-anchors to the trigger centre after any flip or shift, clamped so it never slides past the panel corner radius. Recompute position on scroll and resize behind a requestAnimationFrame throttle, and close rather than reposition once the trigger leaves the visible area. Keep the aria-describedby relationship stable across repositioning so the description is not re-announced. Use role="tooltip" and plain text content with no interactive children.

Prueba en MeDo
ToolbarGroup Skip

Shared Delay Across a Button Row

One provider, one timer. Once the first tooltip in a toolbar has opened, moving along the row should switch content instantly instead of making the user wait 300ms per button.

Create a tooltip provider that shares open state across a group of triggers in a toolbar. The first tooltip in the group waits the full 300ms open delay; while any tooltip in the group is open, moving to a sibling trigger swaps the content with no delay and no exit animation, so the panel appears to slide along the row. Leaving the group entirely closes after a 150ms grace period. Reuse a single positioned panel element rather than mounting one per trigger, and update its aria-describedby target as the active trigger changes. Escape closes the group and returns focus behaviour to normal. Under prefers-reduced-motion, replace the slide with an instant content swap.

Prueba en MeDo
Multi-lineRich Hint

Two-Line Tooltip With a Keyboard Shortcut

A label line plus a monospace shortcut hint on the right. Still passive, still text-only — the moment you want a link in here, you want a popover instead.

Create a tooltip that renders a label line plus a secondary line, with an optional keyboard shortcut rendered as a small monospace chip aligned to the right of the label. Cap the panel at 260px, allow the description to wrap to two lines, and keep line-height at 1.4 so the two lines read as one block. Content stays non-interactive: no links, no buttons, no selectable code — if the user needs to click inside, use a popover. Announce the whole panel as one description via aria-describedby so the shortcut is read as part of the sentence rather than as a separate node. Open after 300ms, close after 100ms, dismiss on Escape and blur.

Prueba en MeDo
OverflowTruncation

Tooltip Only When the Text Is Clipped

Table cells and file names truncate with an ellipsis; a tooltip that repeats already-visible text is noise. Measure the element and only attach the tooltip when scrollWidth exceeds clientWidth.

Create a conditional tooltip for truncated text: compare scrollWidth against clientWidth on the target element and only register hover and focus handlers when the text is actually clipped, so a fully visible cell never shows a tooltip repeating itself. Re-measure on resize and whenever the text content changes, using a ResizeObserver rather than a window listener. When active, show the full string in a dark panel capped at 320px with wrapping enabled, positioned below the cell to avoid covering the row header. Make the truncated element focusable with tabindex="0" only while the tooltip is registered, so keyboard users can reach it without collecting empty tab stops across the whole table.

Prueba en MeDo

Cómo personalizar tu Tooltip

Define los retardos de apertura y cierre por separado

Un retardo compartido es incorrecto en ambas direcciones. Unos 300ms antes de abrir evitan que los tooltips parpadeen mientras el puntero cruza una barra de herramientas, mientras que un retardo de cierre corto de 100ms permite que el puntero viaje del disparador al tooltip sin que el panel desaparezca a mitad de camino.

Pide detección de colisiones, no un lado fijo

Un tooltip anclado arriba se recortará contra la parte superior del viewport o el borde de un contenedor con scroll. Especifica un lado preferido más alternativas para que el componente voltee y se desplace por sí solo, e indica que la flecha debe seguir apuntando al disparador después de moverse.

Exige que el foco lo active, no solo el hover

Si el tooltip solo responde al ratón, los usuarios de teclado no reciben nada. Pide que se abra con focus-visible y que se cierre con Escape y blur, que es también lo que lo hace usable para quien navega con un dispositivo conmutador o un lector de pantalla.

Mantén el contenido pasivo y solo de texto

En el momento en que un tooltip contiene un enlace, un botón o texto copiable, necesita una forma de alcanzarse y mantenerse abierto, y deja de ser un tooltip. Indica que el contenido es texto plano y no interactivo, y recurre a un popover cuando necesites algo clicable dentro.

Quién usa el componente Tooltip

Dashboard o herramienta de administración

Botones de barra de herramientas con solo icono que llevan un nombre accesible real más un tooltip que repite la etiqueta para usuarios de ratón con visión, omitiendo el retardo de apertura cuando el puntero se mueve entre botones adyacentes.

Producto SaaS

Una pista en la leyenda de un gráfico que explica cómo se calcula una métrica, que voltea por debajo del disparador cerca de la parte superior del panel y se cierra al hacer scroll para que nunca flote separada del punto que describe.

Tienda de comercio electrónico

Abreviaturas de la guía de tallas e iconos de insignias de envío anotados al pasar el cursor, con la misma información repetida en el texto visible de la página de producto porque quien compra desde el móvil nunca activará el hover.

Documentación para desarrolladores

Tokens de código en línea y abreviaturas que revelan una firma de tipo de una sola línea al pasar el cursor o al recibir foco, limitados a un ancho máximo estrecho para que el panel nunca cubra el ejemplo de código que explica.

Patrones de Tooltip para distintos sitios web

El mismo componente tooltip, adaptado al tipo de sitio donde se publica.

01 / 06

Dashboard and Admin Tools

Dense toolbars are where tooltips earn their keep and where a per-trigger delay is most annoying. Use one shared provider so moving along a row of icon buttons swaps the label instantly. The tooltip still cannot be the only place the label exists — every icon button needs a real accessible name regardless.

Estilos y variantes de Tooltip

Elige la variante que encaje con el resto de la página y genérala.

01 / 06

Dark Panel Tooltip

A dark slate surface with white text is the default for a reason: it reads as an overlay rather than as page content, so users do not mistake it for a permanent part of the layout. Keep the panel opaque — a translucent tooltip over a chart becomes unreadable exactly where it is needed.

Tooltip en React, Next.js, Vue y Svelte

React, Next.js, Vue 3, SvelteKit, Astro o HTML puro: el mismo tooltip, seis formas de integrarlo.

01 / 06

React Tooltip

Positioning needs real DOM measurement, so this is a client component with refs on both trigger and panel. Portal the panel to document.body — a tooltip inside a container with overflow: hidden will be clipped no matter how correct the coordinates are.

src/components/Tooltip.tsx

export function Tooltip({ label, children }) {
  const [open, setOpen] = useState(false)
  const id = useId()

  return (
    <span
      onPointerEnter={() => setOpen(true)}
      onPointerLeave={() => setOpen(false)}
    >
      {cloneElement(children, { 'aria-describedby': open ? id : undefined })}
      {open && createPortal(<Panel id={id}>{label}</Panel>, document.body)}
    </span>
  )
}

Cómo añadir tu Tooltip a un proyecto

Cuatro pasos, desde elegir una plantilla de tooltip hasta llevarlo a producción.

01~30s

Pick a Tooltip Pattern

Choose by what the trigger already tells the user: a label hint for a named control, the icon-only variant when the tooltip text is the accessible name, or the truncation variant for table cells.

02~10s

Copy the Prompt

Take it into MeDo, Lovable, Bolt, v0 or Cursor, and set the open and close delays before you run it. Those two numbers are what separates a helpful hint from a panel that flickers across a toolbar.

03~1min

Generate and Refine

You get React + Tailwind back with a live preview. Follow up in plain English — "flip below near the top edge", "open instantly on focus", "skip the delay between toolbar buttons" — rather than editing coordinate math by hand.

04~2min

Wire the Triggers and Test the Keyboard

Portal the panel out of any overflow-hidden ancestor, then tab to each trigger and press Escape. If the hint only appears on hover, or Escape does not close it, the component is not shippable yet.

Preguntas frecuentes sobre Tooltip

¿Cómo genero un componente tooltip con IA?

Describe el disparador, la posición y los tiempos en un solo prompt — por ejemplo "un tooltip oscuro sobre el disparador, 300ms de retardo de apertura, que voltee al llegar al borde del viewport, que se abra también con el foco". MeDo genera la lógica de posicionamiento, la flecha, los retardos y el cableado de aria-describedby en conjunto, así el comportamiento es completo y no un simple div con posición absoluta y estilos.

¿Cuál es la diferencia entre un tooltip y un popover?

Un tooltip es pasivo: muestra una descripción breve del elemento al que apuntas, se cierra en cuanto te alejas y no contiene nada clicable. Un popover es interactivo: se abre con un clic, permanece abierto, contiene enlaces, botones o campos de formulario, y atrapa o gestiona el foco. Si te descubres queriendo un botón dentro de un tooltip, lo que querías era un popover.

¿Un tooltip debe usar aria-describedby o aria-label?

Usa aria-describedby cuando el disparador ya tiene un nombre visible o accesible y el tooltip añade detalle complementario, ya que la descripción se anuncia después del nombre. Usa aria-label cuando el texto del tooltip es el único nombre que tiene el control, como en un botón con solo icono, y omite aria-describedby en ese caso para que la misma cadena no se anuncie dos veces.

¿Pueden funcionar los tooltips en dispositivos táctiles?

No de forma fiable. Las pantallas táctiles no tienen estado hover, y la pulsación larga ya está tomada por la selección de texto y los menús contextuales, así que cualquier patrón de tooltip al tocar pelea contra la plataforma. Asume que quienes usan móvil o tablet nunca lo verán y deja todo lo esencial en texto visible o en un nombre accesible.

¿Cuánto debe durar el retardo antes de que se abra un tooltip?

Entre 200 y 500ms funciona bien, con 300ms como valor por defecto seguro. El retardo existe para que los tooltips no parpadeen mientras el puntero cruza una fila de controles camino de otro sitio. Combínalo con un retardo de cierre mucho más corto, de unos 100ms, para que el panel no desaparezca mientras el puntero se acerca a él.

¿Un tooltip debe poder cerrarse con el teclado?

Sí. La WCAG exige que el contenido mostrado al pasar el cursor o al recibir foco se pueda cerrar sin mover el puntero ni el foco, lo que en la práctica significa que Escape lo cierra. También debe permanecer visible el tiempo suficiente para leerlo y seguir siendo hoverable para que el puntero pueda pasar sobre él. Menciona el soporte de teclado en tu prompt y MeDo conecta Escape, blur y el comportamiento de puente al pasar el cursor.