Hero Heading

HeroHeading helps you create headings with eyebrows.


Create headings for your hero elements easily

The HeroHeading structure is built with accessibility in mind — you just have to include eyebrows with Eyebrow if you want them.

index.html
<h2 class="HeroHeading">
<span class="Eyebrow"> Eyebrow </div>
<span> A Typical Heading </span>
</h2>

Eyebrow A Typical Heading

Create your perfect HeroHeading

Styling HeroHeading is easy. You just have to tweak a couple of CSS properties and all your HeroHeading elements will have a consistent look and feel.

index.html
.HeroHeading { /* ... */ }
.Eyebrow { /* ... */ }

Eyebrow A typical heading

Easy alignment to the start, center, and end

Use HeroHeading-* to align the entire hero heading (including the elements within) to the start, center, or end - it’s just that easy!

index.html
<h2 class="HeroHeading-start">...</h2>
<h2 class="HeroHeading-center">...</h2>
<h2 class="HeroHeading-end">...</h2>
Start

EyebrowA typical heading

Center

EyebrowA typical heading

End

EyebrowA typical heading

Adjust the width of your Hero Element without breaking a sweat

No need to worry about realigning HeroHeading items when you set a maximum width. We’ve got that covered.

By the way, all items in HeroHeading have a max-width of 100% so you can just set width instead of max-width.

index.html
<h2 class="HeroHeading-center w-[20ch]"> ... </h2>

This doesn’t violate any best practice! Just resize the component and you’ll see everything function perfectly.

Resize to see this work!

Pretty nifty eyebrowExpress what you need to say — even a long heading is fine