Rich-Tooltips

Rich-Tooltips is a lightweight library for creating customizable tooltips with optional media (images, videos) and text content. This library allows you to display tooltips with rich content like text, images, or videos on hover, providing a modern user experience.

Features

For local testing & development

Usage

  1. Add the data-tooltip property to the element that should have a tooltip.
  2. Add the data-text property with the value for the text that will appear in the tooltip.
  3. Add the data-video or data-image property with the value being the src to the media item.

Examples

Tooltip with Text only

<button data-tooltip data-text="This is a text tooltip">
  Hover over me!
</button>

Tooltip with Image

<button data-tooltip data-image="https://example.com/image.jpg">
  Hover over me to see an image
</button>

Tooltip with Video

<button data-tooltip data-video="https://example.com/video.mp4">
  Hover over me to see a video
</button>

Tooltip with Text and Media (Image/Video)

<button data-tooltip data-text="Here’s a cool video!" data-video="https://example.com/video.mp4">
  Hover over me for video and text
</button>