summaryrefslogtreecommitdiff
path: root/src/components/ui/Headline.astro
diff options
context:
space:
mode:
authorDawid Rycerz <dawid@rycerz.xyz>2025-07-22 15:08:37 +0300
committerDawid Rycerz <dawid@rycerz.xyz>2025-07-22 15:08:37 +0300
commitfcc2f4704e39b0e69b377cc138f75027721dac22 (patch)
tree732fc94b354a26c08fba9cc9059f9c6c900182be /src/components/ui/Headline.astro
Initial template
Diffstat (limited to 'src/components/ui/Headline.astro')
-rw-r--r--src/components/ui/Headline.astro35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/components/ui/Headline.astro b/src/components/ui/Headline.astro
new file mode 100644
index 0000000..6b906b0
--- /dev/null
+++ b/src/components/ui/Headline.astro
@@ -0,0 +1,35 @@
+---
+import type { Headline as Props } from '~/types';
+import { twMerge } from 'tailwind-merge';
+
+const {
+ title = await Astro.slots.render('title'),
+ subtitle = await Astro.slots.render('subtitle'),
+ tagline,
+ classes = {},
+} = Astro.props;
+
+const {
+ container: containerClass = 'max-w-3xl',
+ title: titleClass = 'text-3xl md:text-4xl ',
+ subtitle: subtitleClass = 'text-xl',
+} = classes;
+---
+
+{
+ (title || subtitle || tagline) && (
+ <div class={twMerge('mb-8 md:mx-auto md:mb-12 text-center', containerClass)}>
+ {tagline && (
+ <p class="text-base text-secondary dark:text-primary font-bold tracking-wide uppercase" set:html={tagline} />
+ )}
+ {title && (
+ <h2
+ class={twMerge('font-bold leading-tighter tracking-tighter font-heading text-heading text-3xl', titleClass)}
+ set:html={title}
+ />
+ )}
+
+ {subtitle && <p class={twMerge('mt-4 text-muted', subtitleClass)} set:html={subtitle} />}
+ </div>
+ )
+}