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.

npm

@import "@be-partner-labs/ds/components/hero";

CDN

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@be-partner-labs/ds/dist/components/hero.min.css">

For the full bundle: https://cdn.jsdelivr.net/npm/@be-partner-labs/ds/dist/bpl-ds.min.css

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>
Variable Default Description
--hero-background var(--bp-color-bg) Background color or gradient
--hero-min-height 80dvh Minimum section height
--hero-align center Content alignment: center, left, right
Class Description
bp-hero--center Centered headline and actions (default)
bp-hero--left Left-aligned text
bp-hero--with-image Two-column grid: text + image

Gradient background

Custom gradient hero

Override via --hero-background on the section.

<style>
.demo-hero--gradient {
--hero-min-height: 12rem;
--hero-background: 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-background on the section.</p>
</div>
</section>
✓No axe violationstested 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.
API Availability Used for Without it Polyfill
@starting-style Newly availableBaseline 2024 CSS-only entrance animation on page load No entrance animation, fully functional None needed
Container Queries Widely availableBaseline 2023 Layout shifts at small container widths Static single-column layout always None needed
cqi units Widely availableBaseline 2023 Fluid headline and subheading font-size Fixed font-size from tokens None needed
dvh units Widely availableBaseline 2023 min-height: 80dvh accounts for mobile browser chrome Falls back to vh via cascade None needed
  • --_background, --_min-height, --_align — component-private, do not set directly.