Svelte Heading - Bitblue

Semantic heading levels with shared typography tokens for Bitblue pages

Use Heading for consistent page and section titles. The tag prop sets both the DOM element and the visual scale.

Setup

<script lang="ts">
	import { Heading } from '.';
</script>

Levels

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6
<script lang="ts">
	import { Heading } from '.';
</script>

<Heading tag="h1">Heading 1</Heading>
<Heading tag="h2">Heading 2</Heading>
<Heading tag="h3">Heading 3</Heading>
<Heading tag="h4">Heading 4</Heading>
<Heading tag="h5">Heading 5</Heading>
<Heading tag="h6">Heading 6</Heading>

Custom class

Combine with utility classes for spacing or color overrides.

Primary accent title

<script lang="ts">
	import { Heading } from '.';
</script>

<Heading tag="h3" class="text-primary-600">Primary accent title</Heading>

Props

PropTypeDefaultDescription
tag'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6''h1'Semantic element and size token
childrenSnippet—Heading text / nested content
classClassValue—Extra classes merged with theme
...restHTMLAttributes<HTMLElement>—Passed to the rendered heading element

Theme sizes (tag)

TagClasses
h1text-5xl font-extrabold
h2text-4xl
h3text-3xl
h4text-2xl
h5text-xl
h6text-lg

All levels share font-bold text-gray-900 dark:text-white from the theme base.


© 2026 Bitblue is a registered trademark. All Rights Reserved.