summaryrefslogtreecommitdiffstats
path: root/src/ui/objects/Button.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/objects/Button.tsx
downloadcorvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.tar.gz
corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.tar.bz2
corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.zip
Init
Diffstat (limited to 'src/ui/objects/Button.tsx')
-rw-r--r--src/ui/objects/Button.tsx26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ui/objects/Button.tsx b/src/ui/objects/Button.tsx
new file mode 100644
index 0000000..68e1776
--- /dev/null
+++ b/src/ui/objects/Button.tsx
@@ -0,0 +1,26 @@
1import type { HTMLTag, Polymorphic } from "corvos/plugins/jsx.ts";
2
3import type { Props as ActionButtonProps } from "./ActionButton.tsx";
4
5import { ActionButton } from "./ActionButton.tsx";
6
7export type Props<Tag extends HTMLTag> = Polymorphic<{
8 as?: Tag;
9 variant?: "primary" | ActionButtonProps<Tag>["variant"];
10 size?: ActionButtonProps<Tag>["size"];
11 wide?: boolean;
12 justify?: boolean;
13 children?: JSX.Element;
14}>;
15
16export const Button = <T extends HTMLTag = "a">({ as = "a" as T, variant, ...props }: Props<T>) => (
17 <ActionButton
18 as={as}
19 label-as={variant ? "strong" : "span"}
20 pill
21 selected={!!variant}
22 variant={variant === "primary" ? undefined : variant}
23 // deno-lint-ignore no-explicit-any
24 {...(props as any)}
25 />
26);