-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbutton.html
More file actions
90 lines (84 loc) · 2.89 KB
/
button.html
File metadata and controls
90 lines (84 loc) · 2.89 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
82
83
84
85
86
87
88
89
90
<!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 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="icon-button"></div>
<div id="small-gold-button"></div>
<div id="link-button"></div>
<div id="blank-link-button"></div>
</div>
</div>
<script>
// Setup and initialize button options.
unityReactCore.initButton({
targetSelector: "#default-button",
props: {
label: "Default Button",
onClick: () => alert('Button clicked'),
},
});
unityReactCore.initButton({
targetSelector: "#icon-button",
props: {
color: "gold",
icon: ["fab", "drupal"],
label: "Icon Button",
onClick: () => alert('Button clicked'),
},
});
unityReactCore.initButton({
targetSelector: "#small-gold-button",
props: {
color: "gold",
label: "Small Gold Button",
onClick: () => alert('Button clicked'),
size: "small",
},
});
unityReactCore.initButton({
targetSelector: "#link-button",
props: {
color: "maroon",
href: "/#example-link",
label: "Link Button",
},
});
unityReactCore.initButton({
targetSelector: "#blank-link-button",
props: {
color: "maroon",
href: "/#example-link",
label: "Link Button",
target: "_blank",
},
});
</script>
<script src="./js/example-helper.js"></script>
</body>
</html>