Skip to content

Commit 7573871

Browse files
committed
Merge branch 'patch-2' of https://github.com/drmule/svelte-material-ui into drmule-patch-2
2 parents 6164525 + e0f6625 commit 7573871

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

packages/tab/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,52 @@ npm install --save-dev @smui/tab
1212

1313
https://sveltematerialui.com/demo/tabs
1414

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+
1561
# More Information
1662

1763
See [Tabs](https://material.io/components/tabs) in the Material design spec.

0 commit comments

Comments
 (0)