Skip to content

Commit 5d94cc7

Browse files
committed
Add SplitLayout demo
1 parent 767588b commit 5d94cc7

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

packages/demo/src/main.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import BadgePage from "./routes/BadgePage.tsx";
77
import CheckboxPage from "./routes/CheckboxPage.tsx";
88
import RadioPage from "./routes/RadioPage.tsx";
99
import SingleSelectPage from "./routes/SingleSelectPage.tsx";
10+
import SplitLayoutPage from "./routes/SplitLayout.tsx";
1011
import TextareaPage from "./routes/Textarea.tsx";
1112
import TextfieldPage from "./routes/Textfield.tsx";
1213

@@ -35,6 +36,10 @@ const router = createBrowserRouter([
3536
path: "/single-select",
3637
element: <SingleSelectPage />,
3738
},
39+
{
40+
path: "/split-layout",
41+
element: <SplitLayoutPage />,
42+
},
3843
{
3944
path: "/textarea",
4045
element: <TextareaPage />,

packages/demo/src/routes/Root.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default function Root() {
1010
<li><a href="/checkbox">Checkbox</a></li>
1111
<li><a href="/radio">Radio</a></li>
1212
<li><a href="/single-select">Single Select</a></li>
13+
<li><a href="/split-layout">Split Layout</a></li>
1314
<li><a href="/textarea">Textarea</a></li>
1415
<li><a href="/textfield">Textfield</a></li>
1516
</ul>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { VscodeSplitLayout } from "@vscode-elements/react-elements";
2+
3+
function logEvents(ev: unknown) {
4+
console.log(ev);
5+
}
6+
7+
export default function SplitLayoutPage() {
8+
return (
9+
<div>
10+
<h1>Split Layout</h1>
11+
<VscodeSplitLayout
12+
style={{ width: "500px", height: "500px" }}
13+
onVscSplitLayoutChange={logEvents}
14+
>
15+
<div
16+
slot="start"
17+
style={{
18+
alignItems: "center",
19+
display: "flex",
20+
height: "100%",
21+
justifyContent: "center",
22+
overflow: "hidden",
23+
width: "100%",
24+
}}
25+
>
26+
start
27+
</div>
28+
<div
29+
slot="end"
30+
style={{
31+
alignItems: "center",
32+
display: "flex",
33+
height: "100%",
34+
justifyContent: "center",
35+
overflow: "hidden",
36+
width: "100%",
37+
}}
38+
>
39+
end
40+
</div>
41+
</VscodeSplitLayout>
42+
</div>
43+
);
44+
}

0 commit comments

Comments
 (0)