aboutsummaryrefslogtreecommitdiff
path: root/apps/website/src/components/base/Header.astro
diff options
context:
space:
mode:
Diffstat (limited to 'apps/website/src/components/base/Header.astro')
-rw-r--r--apps/website/src/components/base/Header.astro13
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/website/src/components/base/Header.astro b/apps/website/src/components/base/Header.astro
index 1201798..aea04af 100644
--- a/apps/website/src/components/base/Header.astro
+++ b/apps/website/src/components/base/Header.astro
@@ -13,14 +13,21 @@ const sizes = {
type Headers = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
interface Props extends HTMLAttributes<Headers> {
- size: keyof typeof sizes;
+ size?: keyof typeof sizes;
+ align?: "left" | "center" | "right";
}
-const { size, ...attr } = Astro.props;
+const {
+ size = "lg",
+ align = "left",
+ ...attr
+} = Astro.props;
const Element = sizes[size] as any; // Unfortunately gotta do this
+
+const className = `text-${align}` + (attr.class ? ` ${attr.class}` : "");
---
-<Element {...attr}>
+<Element {...attr} class={className}>
<slot />
</Element>