Skip to content

Commit c30c12e

Browse files
committed
docs: move new example to demo page
1 parent 7573871 commit c30c12e

File tree

2 files changed

+23
-48
lines changed

2 files changed

+23
-48
lines changed

packages/site/src/routes/demo/tabs/_Simple.svelte

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,41 @@
99
</Tab>
1010
</TabBar>
1111

12+
{#if active === 'Home'}
13+
<Paper variant="unelevated">
14+
<Content>Welcome to the Home page! I hope you like SMUI!</Content>
15+
</Paper>
16+
{:else if active === 'Merchandise'}
17+
<Paper variant="unelevated">
18+
<Content>
19+
You want merch? We got so much cool merch! We got SMUI toilet paper,
20+
SMUI ironing boards, SMUI gas pedals! Come and get 'em!
21+
</Content>
22+
</Paper>
23+
{:else if active === 'About Us'}
24+
<Paper variant="unelevated">
25+
<Content>
26+
We are a boutique UI library, ready to get you up and running on
27+
whatever your project is. Whether you're building a web UI for an
28+
automated toaster or a web UI for an automated coffee maker, SMUI is
29+
ready for you!
30+
</Content>
31+
</Paper>
32+
{/if}
33+
1234
<div style="margin-top: 1em;">
1335
<div>Programmatically select:</div>
1436
{#each ['Home', 'Merchandise', 'About Us'] as tab}
1537
<Button on:click={() => (active = tab)}><Label>{tab}</Label></Button>
1638
{/each}
1739
</div>
18-
19-
<pre class="status">Selected: {active}</pre>
2040
</div>
2141

2242
<script lang="ts">
2343
import Tab, { Label } from '@smui/tab';
2444
import TabBar from '@smui/tab-bar';
2545
import Button from '@smui/button';
46+
import Paper, { Content } from '@smui/paper';
2647
2748
let active = 'Home';
2849
</script>

packages/tab/README.md

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,6 @@ 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-
6115
# More Information
6216

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

0 commit comments

Comments
 (0)