- No data uploaded
- Instant results
Tailwind CSS 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
<!-- Requires Tailwind CSS v3 (CLI/PostCSS build, or the Play CDN for prototypes) -->
<section class="px-6 py-20">
<div class="max-w-4xl mx-auto text-center">
<span class="inline-flex items-center px-2.5 py-0.5 text-xs font-semibold rounded-full bg-[#4f46e5]/10 text-[#4f46e5]">New · v2.0 is live</span>
<h1 class="mt-6 text-4xl md:text-5xl font-extrabold tracking-tight leading-tight text-slate-900">Ship beautiful interfaces in minutes, not weeks</h1>
<p class="mt-6 text-lg leading-relaxed text-slate-500">Production-ready components with accessible markup, dark mode and your brand color — copy, paste and ship.</p>
<div class="mt-10 flex flex-wrap items-center justify-center gap-3">
<a href="#" class="inline-flex items-center justify-center px-4 py-2.5 text-sm font-semibold rounded-lg bg-[#4f46e5] hover:bg-[#433cc3] text-white shadow-sm transition-colors focus:outline-none focus:ring-2 focus:ring-[#4f46e5] focus:ring-offset-2 focus:ring-offset-white">Start building free</a>
<a href="#" class="inline-flex items-center justify-center px-4 py-2.5 text-sm font-semibold rounded-lg border transition-colors border-slate-300 text-slate-700 hover:bg-slate-50 focus:outline-none focus:ring-2 focus:ring-[#4f46e5] focus:ring-offset-2 focus:ring-offset-white">View components</a>
</div>
<div class="mt-12 flex flex-wrap justify-center gap-10">
<div>
<p class="text-2xl font-bold text-slate-900">12k+</p>
<p class="text-sm text-slate-500">teams</p>
</div>
<div>
<p class="text-2xl font-bold text-slate-900">99.99%</p>
<p class="text-sm text-slate-500">uptime</p>
</div>
<div>
<p class="text-2xl font-bold text-slate-900">4.9/5</p>
<p class="text-sm text-slate-500">rating</p>
</div>
</div>
</div>
</section>
More Tailwind components for Vanilla JS
All components →- Feature Grid A marketing section with a centered heading and a responsive grid of six feature cards, each with an icon badge, title and description
- Testimonial Slider A customer testimonial carousel that shows one quote at a time with labelled slide buttons — no autoplay, so users stay in control
- Navbar A responsive top navigation bar with a logo, primary links, a sign-in/CTA pair on desktop and a collapsible hamburger menu on mobile
- Pricing Table A three-tier pricing section with a monthly/yearly billing toggle, a highlighted “most popular” plan and feature checklists
- Signup Form A registration card with name, email and password fields, a password hint, a terms-of-service checkbox and a primary call to action
- Login Modal A centered sign-in dialog with email and password fields, “remember me”, a forgot-password link and a social sign-in button
- Contact Form A contact card with name, email, a topic selector, a message textarea and a submit button
- Footer A multi-column site footer with a brand description, three link groups, a newsletter sign-up field and a copyright row
Install Tailwind CSS for Vanilla JS
Prototype instantly with the Play CDN, or install the Tailwind CLI for production:
<script src="https://cdn.tailwindcss.com"></script>npm install -D tailwindcss@3
npx tailwindcss init
npx tailwindcss -i ./src/input.css -o ./dist/output.css --watchAdd ./**/*.html to content in tailwind.config.js and put the three @tailwind directives in src/input.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 utility classes, so the copied code has no runtime dependency on this site.
Compatibility
| Item | Details |
|---|---|
| CSS framework | Tailwind CSS v3.4+ |
| Library | Plain HTML + optional vanilla JS |
| Interactive state | None (static markup) |
| Dark mode | Yes — toggle in the editor |
| Style | Minimal |