-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
66 lines (54 loc) · 2.31 KB
/
index.html
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="onsenui.css" />
<link rel="stylesheet" href="onsen-css-components.css" />
<script src="helper.js"></script>
<script src="out.js" defer></script>
</head>
<body>
<ons-page>
<ons-tabbar>
<ons-page slot="pages">
<ons-toolbar slot="toolbar">
Page 1
</ons-toolbar>
<p>The components on this page were written with idris-web-components.</p>
<p>This includes the toolbar at the top and the tabbar and tabs at the bottom.</p>
<p>Click on a tab to change pages.</p>
</ons-page>
<ons-page slot="pages">
<ons-toolbar slot="toolbar">
Page 2
</ons-toolbar>
<p>Try inspecting the tab of the current page in your browser dev tools.</p>
<p>Notice that it has the <code>active</code> attribute.</p>
<p>Now click on a different tab and notice <code>active</code> has been removed.</p>
<p>This is handled by parent-child communication between the tabbar and tabs components.</p>
</ons-page>
<ons-page slot="pages">
<ons-toolbar slot="toolbar">
Page 3
</ons-toolbar>
<p>As well as attributes and listeners, other features that can be added to Custom Elements with
idris-web-components include:</p>
<ul>
<li>Shadow DOM templates (<code>Template</code>)</li>
<li>The ability to depend on the functionality of another Custom Element (<code>Depend</code>)</li>
<li>Internal state for use in Idris, similar to the React State hook (<code>State</code>)</li>
<li>Properties that do some side-effect when their value is changed (<code>PropEffect</code>)</li>
</ul>
<p>For a full list of features, see the <code>CustomElement</code> data type in
<a target="_blank" href="https://github.com/emccorson/idris-web-components/blob/master/CustomElement/Types.idr">CustomElement/Types.idr</a>.</p>
</ons-page>
<ons-tab class="tabbar__item" slot="tabs">page 1</ons-tab>
<ons-tab class="tabbar__item" slot="tabs">page 2</ons-tab>
<ons-tab class="tabbar__item" slot="tabs">page 3</ons-tab>
</ons-tabbar>
</ons-page>
<script>
window.e = document.querySelector('eric-element');
</script>
</body>
</html>