Tippy.js for Svelte.
$ npm i svelte-ktippy
or
$ yarn add svelte-ktippy
tippy.js makes use of the NODE_ENV on default. To remove it, we use @rollup/plugin-replace
npm i @rollup/plugin-replace
Edit your rollup.config.js
Add: import replace from '@rollup/plugin-replace';
to the head
Add to the plugins array:
replace({
'process.env.NODE_ENV': JSON.stringify('production')
})
<script>
import tooltip from "svelte-ktippy";
import MyRenderedTooltip from "MyRenderedTooltip.svelte"
</script>
<div use:tooltip={{component: MyRenderedTooltip}}>
Hover me
</div>
<script>
import tooltip from "svelte-ktippy";
import TooltipItem from "TooltipItem.svelte"
let myItem = new Item(.....);
</script>
<div use:tooltip={{component: TooltipItem, props: {item: myItem}}>
Hover me
</div>