-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex-CheckBox.tsx.txt
More file actions
58 lines (54 loc) · 1.26 KB
/
index-CheckBox.tsx.txt
File metadata and controls
58 lines (54 loc) · 1.26 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
// register Metro design fonts
import "com.sweaxizone.metro/fonts";
// third-party
import { createRoot } from "react-dom/client";
import * as React from "react";
import {
Root,
Group,
HGroup,
VGroup,
Button,
Label,
Icon,
CheckBox,
FormGroup,
} from "com.sweaxizone.metro/components";
import { RTLProvider } from "com.sweaxizone.metro/layout";
import {
Primary,
ThemePresets,
ThemeProvider,
type Theme,
} from "com.sweaxizone.metro/theme";
/**
* The test.
*/
function App() {
const [checked, set_checked] = React.useState<boolean>(false);
return (
<ThemeProvider theme={ThemePresets.get("dark")}>
<RTLProvider rtl={false}>
<Primary prefer={false}>
<Root
full
solid
selection={false}
style={{
overflowY: "auto",
}}>
<VGroup padding={10}>
<FormGroup>
<Label bold for="c1">{checked ? "On" : "Off"}</Label>
<CheckBox id="c1" default={false} change={v => {set_checked(v)}}/>
</FormGroup>
</VGroup>
</Root>
</Primary>
</RTLProvider>
</ThemeProvider>
);
}
// Render App
const root = createRoot(document.getElementById("root")!);
root.render(<App />);