File tree Expand file tree Collapse file tree 8 files changed +198
-114
lines changed
site/src/routes/demo/tooltip Expand file tree Collapse file tree 8 files changed +198
-114
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ Svelte 5 Runes mode is being migrated to slowly. This is the todo list of compon
197
197
- Tabs
198
198
- [x] Tab
199
199
- [x] Tab Bar
200
- - [ ] Tooltip
200
+ - [x ] Tooltip
201
201
- [ ] Touch Target
202
202
203
203
Note to Devs: update ` indexOf() ` on any ` $state ` array to ` findIndex() ` .
Original file line number Diff line number Diff line change 23
23
</Demo >
24
24
25
25
<Demo component ={Rich } file =" tooltip/_Rich.svelte" >Rich</Demo >
26
+
27
+ <Demo component ={Delayed } file =" tooltip/_Delayed.svelte" >Delayed</Demo >
26
28
</section >
27
29
28
30
<script lang =" ts" >
31
33
import Simple from ' ./_Simple.svelte' ;
32
34
import Positioning from ' ./_Positioning.svelte' ;
33
35
import Rich from ' ./_Rich.svelte' ;
36
+ import Delayed from ' ./_Delayed.svelte' ;
34
37
</script >
Original file line number Diff line number Diff line change
1
+ <div >
2
+ <Wrapper >
3
+ <Button touch >
4
+ <Label >Show Delay: 1s, Hide Delay: 2s</Label >
5
+ </Button >
6
+ <Tooltip showDelay ={1000 } hideDelay ={2000 }>I am a delayed tooltip.</Tooltip >
7
+ </Wrapper >
8
+ </div >
9
+
10
+ <script lang =" ts" >
11
+ import Tooltip , { Wrapper } from ' @smui/tooltip' ;
12
+ import Button , { Label } from ' @smui/button' ;
13
+ </script >
Original file line number Diff line number Diff line change 1
- <svelte:options runes ={false } />
2
-
3
1
<div style =" display: flex; flex-wrap: wrap; align-items: center;" >
4
2
<Wrapper >
5
3
<Button touch >
Original file line number Diff line number Diff line change 1
- <svelte:options runes ={false } />
2
-
3
1
<div style =" display: flex; flex-wrap: wrap; align-items: center;" >
4
2
<!--
5
3
Note: the wrapper on a rich tooltip
64
62
} from ' @smui/tooltip' ;
65
63
import Button , { Label } from ' @smui/button' ;
66
64
67
- let clicked = 0 ;
65
+ let clicked = $state ( 0 ) ;
68
66
</script >
Original file line number Diff line number Diff line change 1
- <svelte:options runes ={false } />
2
-
3
1
<div
4
2
class =" container"
5
3
style =" display: flex; flex-wrap: wrap; align-items: center;"
23
21
<Fab onclick ={() => clicked ++ } mini >
24
22
<Icon class =" material-icons" >favorite</Icon >
25
23
</Fab >
26
- <Tooltip >Tooltip on a FAB.</Tooltip >
24
+ <!-- The unbounded prop adds more gap between the tooltip and anchor. -->
25
+ <Tooltip unbounded >Tooltip on a FAB.</Tooltip >
27
26
</Wrapper >
28
27
29
28
<Wrapper >
43
42
44
43
<Wrapper >
45
44
<span tabindex =" 0" role =" button" >I'm a span element.</span >
46
- <!--
47
- For tooltips on things that don't have a
48
- visually declared boundary, like plain text,
49
- use the `unbounded` prop to remove the gap
50
- between the element and the tooltip.
51
- -->
52
- <Tooltip unbounded >Tooltip on a span.</Tooltip >
45
+ <Tooltip >Tooltip on a span.</Tooltip >
53
46
</Wrapper >
54
47
</div >
55
48
80
73
import Radio from ' @smui/radio' ;
81
74
import { Label , Icon } from ' @smui/common' ;
82
75
83
- let clicked = 0 ;
84
- let checked = false ;
85
- let selected = ' on' ;
76
+ let clicked = $state ( 0 ) ;
77
+ let checked = $state ( false ) ;
78
+ let selected = $state ( ' on' ) ;
86
79
</script >
87
80
88
81
<style >
You can’t perform that action at this time.
0 commit comments