From c1e28224aa2e1450031669d9a7e359b63e04687d Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 22 Jul 2026 19:40:59 +0200 Subject: Init --- src/ui/objects/ActionButton.tsx | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/ui/objects/ActionButton.tsx (limited to 'src/ui/objects/ActionButton.tsx') diff --git a/src/ui/objects/ActionButton.tsx b/src/ui/objects/ActionButton.tsx new file mode 100644 index 0000000..76f859f --- /dev/null +++ b/src/ui/objects/ActionButton.tsx @@ -0,0 +1,61 @@ +import type { HTMLTag, Polymorphic } from "corvos/plugins/jsx.ts"; + +export type Props = Polymorphic<{ + "as"?: Tag; + "label-as"?: string; + "pill"?: boolean; + "icon"?: JSX.Element; + "pre"?: JSX.Element; + "post"?: JSX.Element; + "highlighted"?: boolean; + "selected"?: boolean; + "wide"?: boolean; + "justify"?: boolean; + "align-block"?: boolean; + "level"?: "button" | "badge" | "quiet"; + "variant"?: "accent" | "positive" | "negative" | "warning" | "static-black" | "static-white"; + "size"?: "xs" | "sm" | "lg" | "xl"; + "children"?: JSX.Element; +}>; + +export const ActionButton = ({ + children, + as: Tag = "a" as T, + "label-as": Label = "span", + pill, + pre, + post, + wide, + justify, + icon, + "align-block": alignBlock, + highlighted, + selected, + level, + variant, + size, + class: cls, + ...props +}: Props) => ( + + {pre} {icon ?? } {post} + +); -- cgit v1.3.1