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