Sections

Hero Glass

Centered hero with glassmorphism card overlay, animated glowing orbs, and action buttons.

heroglassmorphismanimated-orbstrustresponsive
Live Preview

Your Complete Component Library

Build stunning landing pages and apps with 200+ accessible, responsive, and customizable components.

Trusted by 5,000+ developers
A B C D +

Usage

Copy and paste this code into your Astro page:

astro
---
import { HeroGlass } from 'astro-component-kit';
---

<HeroGlass />
--- import { HeroGlass } from 'astro-component-kit'; --- <HeroGlass />

Manual Installation

If you are not using the npm package, create a new file src/components/sections/HeroGlass.astro and paste the following code:

astro
---
// HeroGlass.astro
interface Props {
  badge?: string;
  title?: string;
  subtitle?: string;
}

const {
  badge = "Astro Components",
  title = "Your Complete Component Library",
  subtitle = "Build stunning landing pages with zero runtime JavaScript.",
} = Astro.props;
---
<section class="hero-glass">
  <div class="hero-glass__bg" aria-hidden="true">
    <div class="hero-glass__orb hero-glass__orb--1"></div>
    <div class="hero-glass__orb hero-glass__orb--2"></div>
  </div>
  <div class="container">
    <div class="hero-glass__card">
      <span class="hero-glass__label">{badge}</span>
      <h1 class="hero-glass__title">{title}</h1>
      <p class="hero-glass__subtitle">{subtitle}</p>
      <div class="hero-glass__actions">
        <button class="hero-glass__btn hero-glass__btn--primary">Get Started</button>
        <button class="hero-glass__btn hero-glass__btn--secondary">Watch Demo</button>
      </div>
    </div>
  </div>
</section>

<style>
  .hero-glass {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 3rem 1.5rem;
    background: #030712;
  }
  .hero-glass__card {
    max-width: 750px;
    padding: 3.5rem 2.5rem;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    text-align: center;
  }
  .hero-glass__label {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(234,179,8,0.15);
    color: #facc15;
    margin-bottom: 1.25rem;
  }
  .hero-glass__title {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    font-weight: 900;
    color: #fff;
    margin: 0 0 1rem;
  }
  .hero-glass__subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin: 0 0 2rem;
  }
  .hero-glass__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
  }
  .hero-glass__btn {
    padding: 0.85rem 1.75rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
  }
  .hero-glass__btn--primary {
    background: #eab308;
    color: #000;
    border: none;
  }
  .hero-glass__btn--secondary {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
  }
</style>
--- // HeroGlass.astro interface Props { badge?: string; title?: string; subtitle?: string; } const { badge = "Astro Components", title = "Your Complete Component Library", subtitle = "Build stunning landing pages with zero runtime JavaScript.", } = Astro.props; --- <section class="hero-glass"> <div class="hero-glass__bg" aria-hidden="true"> <div class="hero-glass__orb hero-glass__orb--1"></div> <div class="hero-glass__orb hero-glass__orb--2"></div> </div> <div class="container"> <div class="hero-glass__card"> <span class="hero-glass__label">{badge}</span> <h1 class="hero-glass__title">{title}</h1> <p class="hero-glass__subtitle">{subtitle}</p> <div class="hero-glass__actions"> <button class="hero-glass__btn hero-glass__btn--primary">Get Started</button> <button class="hero-glass__btn hero-glass__btn--secondary">Watch Demo</button> </div> </div> </div> </section> <style> .hero-glass { position: relative; min-height: 80vh; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 3rem 1.5rem; background: #030712; } .hero-glass__card { max-width: 750px; padding: 3.5rem 2.5rem; background: rgba(15, 23, 42, 0.65); backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,0.12); border-radius: 24px; text-align: center; } .hero-glass__label { display: inline-block; padding: 0.35rem 0.9rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: rgba(234,179,8,0.15); color: #facc15; margin-bottom: 1.25rem; } .hero-glass__title { font-size: clamp(2.2rem, 4vw, 3.4rem); font-weight: 900; color: #fff; margin: 0 0 1rem; } .hero-glass__subtitle { font-size: 1.1rem; color: #94a3b8; margin: 0 0 2rem; } .hero-glass__actions { display: flex; gap: 1rem; justify-content: center; } .hero-glass__btn { padding: 0.85rem 1.75rem; border-radius: 10px; font-weight: 700; cursor: pointer; } .hero-glass__btn--primary { background: #eab308; color: #000; border: none; } .hero-glass__btn--secondary { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #fff; } </style>