summaryrefslogtreecommitdiffstats
path: root/src/ui/layouts/SplitViewPanel.tsx
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2026-07-22 19:40:59 +0200
committerVolpeon <git@volpeon.ink>2026-07-22 19:40:59 +0200
commitc1e28224aa2e1450031669d9a7e359b63e04687d (patch)
tree68f3d8905c763a91f68001d868197effa92adafa /src/ui/layouts/SplitViewPanel.tsx
downloadcorvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.tar.gz
corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.tar.bz2
corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.zip
Init
Diffstat (limited to 'src/ui/layouts/SplitViewPanel.tsx')
-rw-r--r--src/ui/layouts/SplitViewPanel.tsx33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ui/layouts/SplitViewPanel.tsx b/src/ui/layouts/SplitViewPanel.tsx
new file mode 100644
index 0000000..7f04b44
--- /dev/null
+++ b/src/ui/layouts/SplitViewPanel.tsx
@@ -0,0 +1,33 @@
1import type { HTMLTag, Polymorphic } from "corvos/plugins/jsx.ts";
2
3export type Props<Tag extends HTMLTag> = Polymorphic<{
4 as: Tag;
5 sticky?: boolean;
6 side?: "25";
7 min?: "50" | "100" | "200";
8 fill?: boolean;
9}>;
10
11export const SplitViewPanel = <T extends HTMLTag = "div">({
12 as: Tag = "div" as T,
13 sticky,
14 side,
15 min,
16 fill,
17 class: cls,
18 ...props
19}: Props<T>) => (
20 <Tag
21 class:list={[
22 "l-split-view__panel",
23 {
24 "l-split-view__panel--sticky": sticky,
25 [`l-split-view__panel--side-${side}`]: side,
26 [`l-split-view__panel--min-${min}`]: min,
27 "l-split-view__panel--fill": fill,
28 },
29 cls,
30 ]}
31 {...props}
32 />
33);