Skip to content

Commit 4f1f6d0

Browse files
committed
feat: headingコンポーネントを作成
1 parent 88150b5 commit 4f1f6d0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

2025/src/components/Heading.astro

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
type Props = {
3+
class?: string;
4+
level?: 1 | 2 | 3 | 4 | 5 | 6;
5+
};
6+
7+
const { class: className, level = 2 }: Props = Astro.props;
8+
---
9+
10+
{
11+
level === 2 && (
12+
<div class="mb-8 text-center">
13+
<h2
14+
class:list={[
15+
className,
16+
"mb-3 text-2xl font-bold text-gray-900 md:text-3xl",
17+
]}
18+
>
19+
<slot />
20+
</h2>
21+
<div class="mx-auto h-1 w-16 bg-emerald-500" />
22+
</div>
23+
)
24+
}

0 commit comments

Comments
 (0)