@appstractdk/as-tooltip

Generic global tooltip component.

Usage no npm install needed!

<script type="module">
  import appstractdkAsTooltip from 'https://cdn.skypack.dev/@appstractdk/as-tooltip';
</script>

README

as-tooltip

Generic global tooltip component.

Usage

The following HTML is needed for the tooltip to work:

<div class="tooltip">
    <div class="tooltip-content"></div>
</div>

and then on any tooltipped element, you have the following data attribute:

<div class="myexample" data-tooltip="My tooltip here!"></div>

Another option, where there is a need to have the content of the tooltip formatted, you have to reference the element containing that data in data-tooltip-content attribute:

<div class="myexample" data-tooltip data-tooltip-content="#tooltip-template-content"></div>

<template id="tooltip-template-content">
    <h1>My tooltip here!</h1>
</template>