A simple and lightweight tooltip library
npm install @ionited/tooltip
npm i @ionited/tooltip
`
$3
https://unpkg.com/@ionited/tooltip@latest/dist/tooltip.js
---
Usage
To basic usage you can simply call:
`js
Tooltip(document.querySelector('button')); // Defaults to get title attribute content
`
$3
`ts
Tooltip(el: HTMLElement, options?: TooltipOptions): TooltipCore
interface TooltipOptions {
content?: string;
contentAttr: string = 'title';
showOnClick: boolean = false;
}
interface TooltipCore {
destroy(): void;
hide(): void;
show(): void;
update(): void;
}
``