Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
Tooltip.svelte
tooltip.js
<script>
import {tooltip} from './tooltip';
let name = 'world';
</script>

<h1>Hello {name}!</h1>
<p>This is a tooltip example. Hover over <span use:tooltip data-tooltip="Hello world">this element</span> to see the tooltip.</p>
<p><small><strong>Note:</strong> Go to "Tooltip.svelte" file to uncomment some css that makes this tooltip more dynamic.</small></p>
<p>by <a href="https://github.com/monkeytempal" target="_blank"><span use:tooltip data-tooltip="Follow me on github">@monkeytempal</span></a></p>

<style>
[data-tooltip] {
color: skyblue;
display: inline-block;
}
</style>
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */