-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbuttonIconOnly.html
More file actions
81 lines (75 loc) · 2.72 KB
/
buttonIconOnly.html
File metadata and controls
81 lines (75 loc) · 2.72 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Button Icon Only component - Example page</title>
<!-- CSS only -->
<link rel="stylesheet" href="../../unity-bootstrap-theme/dist/unity-bootstrap-theme2.css" />
<!-- Load FontAwesome -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"
integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<script
src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/js/all.min.js"
integrity="sha512-uKQ39gEGiyUJl4AI6L+ekBdGKpGw4xJ55+xyJG7YFlJokPNYegn9KwQ3P8A7aFQAUtUsAQHep+d/lrGqrbPIDQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- *************************************************************** -->
<!-- Load React. -->
<script src="https://unpkg.com/react@18.3.1/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@18.3.1/umd/react-dom.development.js" crossorigin></script>
<!-- *************************************************************** -->
<!-- include bundled scripts from packages -->
<script src="../dist/unityReactCore.umd.js"></script>
</head>
<body>
<div class="container">
<div class="d-flex justify-content-center border p-4">
<!-- Provide target elements -->
<div id="default-button"></div>
<div id="close-button"></div>
<div id="next-button"></div>
<div id="prev-button"></div>
</div>
</div>
<script>
// Setup and initialize button icon only options.
unityReactCore.initButtonIconOnly({
targetSelector: "#default-button",
props: {
color: "white",
icon: ["fas", "times"],
onClick: () => alert("Button clicked"),
},
});
unityReactCore.initButtonIconOnly({
targetSelector: "#close-button",
props: {
color: "white",
icon: ["fas", "times"],
onClick: () => alert("Button clicked"),
},
});
unityReactCore.initButtonIconOnly({
targetSelector: "#next-button",
props: {
color: "white",
icon: ["fas", "chevron-right"],
size: "large",
onClick: () => alert("Button clicked"),
},
});
unityReactCore.initButtonIconOnly({
targetSelector: "#prev-button",
props: {
color: "white",
icon: ["fas", "chevron-left"],
size: "large",
onClick: () => alert("Button clicked"),
},
});
</script>
<script src="./js/example-helper.js"></script>
</body>
</html>