Skip to content

Commit 8afe255

Browse files
committed
docs(examples): add example of using show with timer
1 parent 49d957f commit 8afe255

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/src/App.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
import ComponentAsContent from './content.svelte';
55
66
let showTooltip = false;
7+
let autoHideTooltip = true;
8+
9+
setTimeout(() => {
10+
autoHideTooltip = false;
11+
}, 5000);
712
</script>
813

914
<main>
@@ -81,7 +86,7 @@
8186
<h2>Examples using component</h2>
8287

8388
<div class="example">
84-
This tooltip should appear on the <Tooltip content="hello world!" action="click" show={!showTooltip}><u>top</u></Tooltip> and use the content in the <code>title</code> attribute.
89+
This tooltip should appear on the <Tooltip content="hello world!" action="click" show={autoHideTooltip}><u>top</u></Tooltip> and use the content in the <code>title</code> attribute. It will auto-hide in 5 seconds.
8590
</div>
8691

8792
<div class="example">

0 commit comments

Comments
 (0)