Overview
TheTitle component renders semantic HTML heading elements (h1 through h6) with appropriate styling based on the heading level. It supports size overrides to decouple visual appearance from semantic structure.
Import
Basic Usage
Heading Levels
Control the semantic heading level with theorder prop:
Default Styling by Order
| Order | Element | Default Style |
|---|---|---|
1 | h1 | text-4xl font-extrabold tracking-tight |
2 | h2 | text-3xl font-bold tracking-tight |
3 | h3 | text-2xl font-bold |
4 | h4 | text-xl font-semibold |
5 | h5 | text-lg font-semibold |
6 | h6 | text-base font-semibold |
Size Override
Override the default size while maintaining semantic structure:Available Sizes
| Size | Style |
|---|---|
xs | text-sm font-semibold |
sm | text-base font-semibold |
md | text-xl font-semibold |
lg | text-2xl font-bold |
xl | text-3xl font-bold |
2xl | text-4xl font-extrabold tracking-tight |
3xl | text-5xl font-extrabold tracking-tight |
4xl | text-6xl font-extrabold tracking-tight |
Examples
Page Header
Section with Visual Override
Semantic Structure
Maintain proper heading hierarchy while controlling visual size:Extra Large Display
Props
Semantic heading level (generates h1-h6 element)
Override the default size for the heading level
Additional CSS classes
Heading content
All standard HTML heading element props (id, aria-*, etc.)
Type Definition
Source:/home/daytona/workspace/source/src/components/typography/Title.tsx:6