Skip to content
  • No data uploaded
  • Instant results

Bootstrap 5 Hero Section for Vanilla JS

A production-ready minimal hero section: a landing-page hero with an announcement badge, a large headline, supporting copy, primary and secondary calls to action and a row of social-proof stats. Pick your brand color, toggle dark mode and corner radius — the live preview and the Vanilla JS code update instantly in your browser.

Live component editor

Library
Framework
Style
Theme
Corner radius
Live preview
<!-- Requires Bootstrap 5.3 CSS + theme.css:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="theme.css"> -->
<section class="px-4 py-5">
  <div class="mw-4xl mx-auto text-center">
    <span class="badge rounded-pill bg-brand-subtle text-brand">New · v2.0 is live</span>
    <h1 class="mt-4 fs-2 fw-bolder lh-sm text-body-emphasis">Ship beautiful interfaces in minutes, not weeks</h1>
    <p class="mt-4 fs-5 lh-lg text-body-secondary">Production-ready components with accessible markup, dark mode and your brand color — copy, paste and ship.</p>
    <div class="mt-5 d-flex flex-wrap align-items-center justify-content-center gap-2">
      <a href="#" class="btn btn-brand fw-semibold rounded-2">Start building free</a>
      <a href="#" class="btn btn-outline-secondary fw-semibold rounded-2">View components</a>
    </div>
    <div class="mt-5 d-flex flex-wrap justify-content-center gap-5">
      <div>
        <p class="fs-4 fw-bold text-body-emphasis">12k+</p>
        <p class="small text-body-secondary">teams</p>
      </div>
      <div>
        <p class="fs-4 fw-bold text-body-emphasis">99.99%</p>
        <p class="small text-body-secondary">uptime</p>
      </div>
      <div>
        <p class="fs-4 fw-bold text-body-emphasis">4.9/5</p>
        <p class="small text-body-secondary">rating</p>
      </div>
    </div>
  </div>
</section>
All components →

Free Bootstrap 5 Hero Section for Vanilla JS by pGento

Install Bootstrap 5 for Vanilla JS

Include Bootstrap 5.3 from the CDN (or npm install bootstrap) and the generated theme.css:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="theme.css">

Use the hero section in Vanilla JS

Paste the markup where the component should appear. It is pure HTML/CSS — no JavaScript required.

Accessibility & customization

The headline is the page’s single <h1>, CTAs are links with descriptive text, and stats use a definition-list-like structure readable in order by screen readers.

Every color, radius and dark-mode choice is baked into plain Bootstrap classes plus a tiny CSS-variable theme file, so the copied code has no runtime dependency on this site.

Compatibility

ItemDetails
CSS frameworkBootstrap 5.3+ (CSS only)
LibraryPlain HTML + optional vanilla JS
Interactive stateNone (static markup)
Dark modeYes — toggle in the editor
StyleMinimal

Frequently asked questions

How do I install this Bootstrap hero section in Vanilla JS?
Create a web page, install Bootstrap 5 as shown in the installation section, then paste the generated code. Also save the generated theme.css file.
Can I change the color of the hero section?
Yes. Use the brand color picker or type any hex code — the preview and code update instantly, and the color is written directly into the classes you copy.
Does the hero section support dark mode?
Yes. Toggle “Dark mode” in the editor to generate a dark palette version of the same component.
Is the hero section accessible?
The headline is the page’s single <h1>, CTAs are links with descriptive text, and stats use a definition-list-like structure readable in order by screen readers.
Is this component free for commercial use?
Yes. The generated code is yours to use in personal and commercial projects without attribution.
Bootstrap 5 Hero Section for Vanilla JS

Embed this tool on your site

Paste this code into any web page. It stays free, fast and ad-free inside your site.

Print or save as PDF

Prints just this tool and its result. Choose “Save as PDF” as the printer to get a file. Branding is stored only in this browser.