-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
BasicPager.svelte
37 lines (34 loc) · 995 Bytes
/
BasicPager.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<script lang="ts">
import { goBack } from 'svelte-native';
import { Template } from 'svelte-native/components';
const items = [
{ title: 'First', color: '#e67e22' },
{ title: 'Second', color: '#3498db' },
{ title: 'Third', color: '#e74c3c' },
{ title: 'Fourth', color: '#9b59b6' }
];
</script>
<page>
<actionBar title="Basic Pager">
<navigationButton text="Go back" on:tap={() => goBack()} />
</actionBar>
<stackLayout class="page">
<pager {items} height="100%">
<Template let:item>
<gridlayout backgroundColor={item.color}>
<label class="label" text={item.title} />
</gridlayout>
</Template>
</pager>
</stackLayout>
</page>
<style>
.label {
font-size: 35;
width: 100%;
text-align: center;
vertical-alignment: center;
color: #ffffff;
text-transform: uppercase;
}
</style>