Centered Hero
A copy-paste hero sections component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Hero SectionsHTMLCSSany framework
Now in beta
Ship faster.
Build apps without the build step.
Copy into your project
HTML
<!-- Centered Hero — pill, headline, sub, CTA all stagger up -->
<section class="nuda-hero-c">
<span class="nuda-hero-c__pill">Now in beta</span>
<h1 class="nuda-hero-c__title">Ship faster.</h1>
<p class="nuda-hero-c__sub">Build apps without the build step.</p>
<button class="nuda-hero-c__cta" type="button">Get started</button>
</section>CSS
/* Centered Hero
Pill + headline + sub + CTA in a vertical stagger.
Customize: --hc-accent, copy & sizes. */
.nuda-hero-c {
--hc-accent: #e4ff54;
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
padding: 80px 24px;
text-align: center;
width: 100%;
max-width: 720px;
margin: 0 auto;
}
.nuda-hero-c__pill {
font: 700 0.625rem ui-sans-serif, system-ui, sans-serif;
color: var(--hc-accent);
background: rgba(228, 255, 84, 0.1);
border: 1px solid rgba(228, 255, 84, 0.2);
padding: 4px 12px;
border-radius: 999px;
text-transform: uppercase;
letter-spacing: 0.08em;
animation: nuda-hc-up 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.nuda-hero-c__title {
font: 800 clamp(2.5rem, 6vw, 4.5rem) ui-sans-serif, system-ui, sans-serif;
color: #fafafa;
margin: 0;
line-height: 1;
letter-spacing: -0.02em;
background: linear-gradient(180deg, #fafafa 60%, var(--hc-accent));
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
animation: nuda-hc-up 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.1s backwards;
}
.nuda-hero-c__sub {
font: 500 1.125rem ui-sans-serif, system-ui, sans-serif;
color: #a1a1aa;
margin: 0;
animation: nuda-hc-up 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}
.nuda-hero-c__cta {
margin-top: 8px;
padding: 12px 28px;
background: var(--hc-accent);
color: #09090b;
border: none;
border-radius: 8px;
font: 700 0.95rem ui-sans-serif, system-ui, sans-serif;
cursor: pointer;
animation:
nuda-hc-up 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.3s backwards,
nuda-hc-glow 2.4s ease-in-out 1s infinite;
}
@keyframes nuda-hc-up {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes nuda-hc-glow {
0%, 100% { box-shadow: 0 0 0 rgba(228, 255, 84, 0); }
50% { box-shadow: 0 0 24px rgba(228, 255, 84, 0.4); }
}
@media (prefers-reduced-motion: reduce) {
.nuda-hero-c__pill, .nuda-hero-c__title,
.nuda-hero-c__sub, .nuda-hero-c__cta { animation: none; }
}How to use Centered Hero
Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.
Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.