Skip to content

Hero

.bp-hero provides a full-bleed page hero with a CSS-only entrance animation using @starting-style. No JavaScript needed for the animation. Supports three layout variants: centered, left-aligned, and with-image.

Centered (default)

Design System

Build beautiful interfaces faster

Token-driven CSS components that work everywhere.

<style>
.demo-hero--centered { --hero-min-height: 18rem; }
</style>
<section class="bp-hero bp-hero--center demo-hero--centered">
<div class="bp-hero__inner">
<span class="bp-hero__eyebrow">Design System</span>
<h1 class="bp-hero__headline">Build beautiful interfaces faster</h1>
<p class="bp-hero__subheading">Token-driven CSS components that work everywhere.</p>
<div class="bp-hero__actions">
<a href="/components/button/" class="bp-btn">Get started</a>
<a href="/tokens/tokens/" class="bp-btn bp-btn--ghost">View tokens</a>
</div>
</div>
</section>

Left-aligned

Open Source

CSS that works for you

No framework lock-in. Drop in CSS, get a design system.

<style>
.demo-hero--left { --hero-min-height: 14rem; }
</style>
<section class="bp-hero bp-hero--left demo-hero--left">
<div class="bp-hero__inner">
<span class="bp-hero__eyebrow">Open Source</span>
<h2 class="bp-hero__headline">CSS that works for you</h2>
<p class="bp-hero__subheading">No framework lock-in. Drop in CSS, get a design system.</p>
<div class="bp-hero__actions">
<a href="#" class="bp-btn">Read the docs</a>
</div>
</div>
</section>
VariableDefaultDescription
--hero-bgvar(--bp-color-bg)Background color or gradient
--hero-min-height80dvhMinimum section height
--hero-aligncenterContent alignment: center, left, right
ClassDescription
bp-hero--centerCentered headline and actions (default)
bp-hero--leftLeft-aligned text
bp-hero--with-imageTwo-column grid: text + image

Gradient background

Custom gradient hero

Override via --hero-bg on the section.

<style>
.demo-hero--gradient {
--hero-min-height: 12rem;
--hero-bg: linear-gradient(135deg, var(--bp-color-text), var(--bp-primary));
}
.demo-hero--gradient .bp-hero__headline,
.demo-hero--gradient .bp-hero__subheading { color: var(--bp-color-text-inverse); }
</style>
<section class="bp-hero bp-hero--center demo-hero--gradient">
<div class="bp-hero__inner">
<h2 class="bp-hero__headline">Custom gradient hero</h2>
<p class="bp-hero__subheading">Override via --hero-bg on the section.</p>
</div>
</section>
No axe violations tested 2026-05-11
  • Use <h1> for the headline when the hero is the page’s primary heading. Use <h2> or lower only if an <h1> exists elsewhere on the page (e.g. in a skip-nav or invisible title). The demos use <h2> to avoid conflicting with Starlight’s own <h1>.
  • The entrance animation respects prefers-reduced-motion via the global reset rule.
APIAvailabilityUsed forWithout itPolyfill
@starting-style Newly available Baseline 2024 CSS-only entrance animation on page loadNo entrance animation, fully functionalNone needed
Container Queries Widely available Baseline 2023 Layout shifts at small container widthsStatic single-column layout alwaysNone needed
cqi units Widely available Baseline 2023 Fluid headline and subheading font-sizeFixed font-size from tokensNone needed
dvh units Widely available Baseline 2023 min-height: 80dvh accounts for mobile browser chromeFalls back to vh via cascadeNone needed
  • --_bg, --_min-height, --_align — component-private, do not set directly.