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/Container.tsx | |
| download | corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.tar.gz corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.tar.bz2 corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.zip | |
Init
Diffstat (limited to 'src/ui/layouts/Container.tsx')
| -rw-r--r-- | src/ui/layouts/Container.tsx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ui/layouts/Container.tsx b/src/ui/layouts/Container.tsx new file mode 100644 index 0000000..7ce7ed5 --- /dev/null +++ b/src/ui/layouts/Container.tsx | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | import type { HTMLTag, Polymorphic } from "corvos/plugins/jsx.ts"; | ||
| 2 | |||
| 3 | export type Props<Tag extends HTMLTag> = Polymorphic<{ | ||
| 4 | "as": Tag; | ||
| 5 | "pad-inline"?: boolean; | ||
| 6 | "pad-block"?: boolean; | ||
| 7 | "size"?: "sm"; | ||
| 8 | "fixed"?: boolean | "150" | "200"; | ||
| 9 | }>; | ||
| 10 | |||
| 11 | export const Container = <T extends HTMLTag = "div">({ | ||
| 12 | as: Tag = "div" as T, | ||
| 13 | class: cls, | ||
| 14 | "pad-inline": padInline, | ||
| 15 | "pad-block": padBlock, | ||
| 16 | fixed, | ||
| 17 | size, | ||
| 18 | ...props | ||
| 19 | }: Props<T>) => ( | ||
| 20 | <Tag | ||
| 21 | class:list={[ | ||
| 22 | "l-container", | ||
| 23 | { | ||
| 24 | "l-container--pad-i": padInline, | ||
| 25 | "l-container--pad-b": padBlock, | ||
| 26 | [`l-container--${size}`]: size, | ||
| 27 | [`l-container--fixed${typeof fixed === "boolean" ? "" : `-${fixed}`}`]: fixed, | ||
| 28 | }, | ||
| 29 | cls, | ||
| 30 | ]} | ||
| 31 | {...props} | ||
| 32 | /> | ||
| 33 | ); | ||
