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.
npm install
npm start
to start up the webpack server for live reload.data-tooltip
property to the element that should have a tooltip.data-text
property with the value for the text that will appear in the tooltip.data-video
or data-image
property with the value being the src to the media item.<button data-tooltip data-text="This is a text tooltip">
Hover over me!
</button>
<button data-tooltip data-image="https://example.com/image.jpg">
Hover over me to see an image
</button>
<button data-tooltip data-video="https://example.com/video.mp4">
Hover over me to see a video
</button>
<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>