aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docs/components/Badge.tsx
diff options
context:
space:
mode:
authorHsiangNianian <admin@jyunko.cn>2023-04-22 19:52:26 +0800
committerHsiangNianian <admin@jyunko.cn>2023-04-22 19:52:26 +0800
commit4838df315931bb883f704ec3e1abe2685f296cdf (patch)
tree57a8550c4cd5338f1126364bb518c6cde8d96e7d /docs/components/Badge.tsx
parentdb74ade0234a40c2120ad5f2a41bee50ce13de02 (diff)
downloadHydroRoll-4838df315931bb883f704ec3e1abe2685f296cdf.tar.gz
HydroRoll-4838df315931bb883f704ec3e1abe2685f296cdf.zip
😀
Diffstat (limited to 'docs/components/Badge.tsx')
-rw-r--r--docs/components/Badge.tsx24
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/components/Badge.tsx b/docs/components/Badge.tsx
new file mode 100644
index 0000000..45e5a0c
--- /dev/null
+++ b/docs/components/Badge.tsx
@@ -0,0 +1,24 @@
+import cn from "classnames";
+
+import type { ReactNode } from "react";
+
+export type BadgeProps = React.ComponentProps<"span"> & {
+ children: ReactNode;
+ className?: string;
+};
+
+export default function Badge(props: BadgeProps) {
+ const { children, className, ...rest } = props;
+
+ return (
+ <span
+ className={cn(
+ "dark:text-black text-white inline-flex items-center justify-center shrink-0 box-border rounded-lg capitalize whitespace-nowrap font-bold tabular-nums h-5 px-2 text-xs bg-gradient-to-r from-[#d74a41] to-[#407aeb] align-middle",
+ className
+ )}
+ {...rest}
+ >
+ {children}
+ </span>
+ );
+}