-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSectionHeader.tsx
More file actions
35 lines (31 loc) · 944 Bytes
/
Copy pathSectionHeader.tsx
File metadata and controls
35 lines (31 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"use client";
import { motion } from "framer-motion";
interface SectionHeaderProps {
tag?: string;
title: string;
subtitle?: string;
}
const SectionHeader = ({ tag, title, subtitle }: SectionHeaderProps) => (
<motion.div
initial={{ opacity: 0, y: 30 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, margin: "-100px" }}
transition={{ duration: 0.6 }}
className="text-center mb-12 lg:mb-16"
>
{tag && (
<span className="inline-block font-heading text-[0.65rem] tracking-[0.3em] text-primary mb-3 border border-primary/30 px-4 py-1 rounded-sm">
{tag}
</span>
)}
<h2 className="font-heading text-2xl md:text-3xl lg:text-4xl font-bold text-foreground mb-3">
{title}
</h2>
{subtitle && (
<p className="text-muted-foreground max-w-2xl mx-auto text-sm md:text-base">
{subtitle}
</p>
)}
</motion.div>
);
export default SectionHeader;