summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components/card.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/ui/src/components/card.tsx')
-rw-r--r--packages/ui/src/components/card.tsx22
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/ui/src/components/card.tsx b/packages/ui/src/components/card.tsx
new file mode 100644
index 000000000..3fb225ab2
--- /dev/null
+++ b/packages/ui/src/components/card.tsx
@@ -0,0 +1,22 @@
+import { type ComponentProps, splitProps } from "solid-js"
+
+export interface CardProps extends ComponentProps<"div"> {
+ variant?: "normal" | "error" | "warning" | "success" | "info"
+}
+
+export function Card(props: CardProps) {
+ const [split, rest] = splitProps(props, ["variant", "class", "classList"])
+ return (
+ <div
+ {...rest}
+ data-component="card"
+ data-variant={split.variant || "normal"}
+ classList={{
+ ...(split.classList ?? {}),
+ [split.class ?? ""]: !!split.class,
+ }}
+ >
+ {props.children}
+ </div>
+ )
+}