diff options
| author | Volpeon <git@volpeon.ink> | 2026-07-22 19:40:59 +0200 |
|---|---|---|
| committer | Volpeon <git@volpeon.ink> | 2026-07-22 19:40:59 +0200 |
| commit | c1e28224aa2e1450031669d9a7e359b63e04687d (patch) | |
| tree | 68f3d8905c763a91f68001d868197effa92adafa /src/ui/layouts/SplitView.tsx | |
| download | corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.tar.gz corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.tar.bz2 corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.zip | |
Init
Diffstat (limited to 'src/ui/layouts/SplitView.tsx')
| -rw-r--r-- | src/ui/layouts/SplitView.tsx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ui/layouts/SplitView.tsx b/src/ui/layouts/SplitView.tsx new file mode 100644 index 0000000..81a55d1 --- /dev/null +++ b/src/ui/layouts/SplitView.tsx | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | import type { HTMLTag, Polymorphic } from "corvos/plugins/jsx.ts"; | ||
| 2 | |||
| 3 | export type Props<Tag extends HTMLTag> = Polymorphic<{ | ||
| 4 | "as": Tag; | ||
| 5 | "gapless"?: boolean; | ||
| 6 | "wrap-reverse"?: boolean; | ||
| 7 | }>; | ||
| 8 | |||
| 9 | export const SplitView = <T extends HTMLTag = "div">({ | ||
| 10 | as: Tag = "div" as T, | ||
| 11 | gapless, | ||
| 12 | "wrap-reverse": wrapReverse, | ||
| 13 | class: cls, | ||
| 14 | ...props | ||
| 15 | }: Props<T>) => ( | ||
| 16 | <Tag | ||
| 17 | class:list={[ | ||
| 18 | "l-split-view", | ||
| 19 | { | ||
| 20 | "l-split-view--gapless": gapless, | ||
| 21 | "l-split-view--wrap-reverse": wrapReverse, | ||
| 22 | }, | ||
| 23 | cls, | ||
| 24 | ]} | ||
| 25 | {...props} | ||
| 26 | /> | ||
| 27 | ); | ||
