A lightweight, API-driven library to transform boring native tooltips into rich, interactive, and modern UI elements for any web project.
Control the entire lifecycle with init(), destroy(), and
updateConfig(). Perfect for SPAs (React, Vue, Svelte) and extensions.
Go beyond plain text. Add lists, links, icons, images, custom fonts, and colors directly inside
your title attribute using simple shortcodes.
With Shadow DOM support and a `MutationObserver`, tooltips work reliably on dynamic content and complex web components out of the box.
The library works in three simple steps:
Control the library programmatically. Here are the core methods:
// Initialize the library with custom settings
UniversalToaster.init({
delay: 200, // ms before showing
backgroundColor: null, // e.g. "#333"
textColor: null, // e.g. "#fff"
// TYPOGRAPHY
fontFamily: "inherit", // Uses page font
fontSize: "13px",
fontWeight: "500",
// SHAPE
borderRadius: "6px",
padding: "8px 12px",
boxShadow: "0 4px 12px rgba(0,0,0,0.15)"
});
// Update settings on the fly
UniversalToaster.updateConfig({ borderRadius: '20px' });
// Cleanly remove all listeners and elements (for SPAs)
UniversalToaster.destroy();
Use lists and horizontal rules (&hr;) to structure information clearly.
Using &lnk=; makes the tooltip interactive, allowing users to hover and click links.
Combine images, icons, and text styles to create detailed profile cards.
Perfect for e-commerce sites to show quick product details without a full modal.
Use &w=400px; to override the default width for content like code snippets.
The library detects the dark background and automatically inverts the tooltip colors for high contrast.