@@ -12,6 +12,52 @@ npm install --save-dev @smui/tab
12
12
13
13
https://sveltematerialui.com/demo/tabs
14
14
15
+ [ See it in action.] ( https://sveltematerialui.com/demo/tabs )
16
+
17
+ [ See the demo code.] ( /site/src/routes/demo/tabs/ )
18
+
19
+ # Basic Usage
20
+
21
+ Use if/else conditional constructs to display tab content, eg:
22
+
23
+ ``` javascript
24
+ < script>
25
+ import TabBar from ' @smui/tab-bar' ;
26
+ import Tab from ' @smui/tab' ;
27
+ import Paper , { Subtitle } from ' @smui/paper' ;
28
+ let active = ' Home' ;
29
+ < / script>
30
+ < TabBar tabs= {[' Home' , ' Merchandise' , ' About Us' ]} let: tab bind: active>
31
+ <!-- Note: the ` tab` property is required! -->
32
+ < Tab {tab} tabIndicator$transition= " fade" >
33
+ < Label> {tab}< / Label>
34
+ < / Tab>
35
+ < / TabBar>
36
+ {#if active === " Home" }
37
+ < Paper class = " paper-demo" >
38
+ < Title> Paper< / Title>
39
+ < Subtitle> This is a sheet of paper.< / Subtitle>
40
+ < Content> Home Content.< / Content>
41
+ < / Paper>
42
+ {: else if active === " Merchandise" }
43
+ < Paper class = " paper-demo" >
44
+ < Title> Paper< / Title>
45
+ < Subtitle> This is a sheet of paper.< / Subtitle>
46
+ < Content> Merchandise content.< / Content>
47
+ < / Paper>
48
+ {: else if active === " About Us" }
49
+ < Paper class = " paper-demo" >
50
+ < Title> Paper< / Title>
51
+ < Subtitle> This is a sheet of paper.< / Subtitle>
52
+ < Content> About Content.< / Content>
53
+ < / Paper>
54
+ {/ if }
55
+ ```
56
+
57
+ # Exports
58
+
59
+ todo...
60
+
15
61
# More Information
16
62
17
63
See [ Tabs] ( https://material.io/components/tabs ) in the Material design spec.
0 commit comments