- No data uploaded
- Instant results
Tailwind CSS Hero Section for React — Glassmorphism
A production-ready glassmorphism 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 React code update instantly in your browser.
Live component editor
export default function HeroSection() {
return (
<section className="px-6 py-20">
<div className="max-w-4xl mx-auto text-center">
<span className="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 className="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 className="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 className="mt-10 flex flex-wrap items-center justify-center gap-3">
<a href="#" className="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="#" className="inline-flex items-center justify-center px-4 py-2.5 text-sm font-semibold rounded-lg border transition-colors border-white/80 bg-white/40 text-slate-800 hover:bg-white/70 focus:outline-none focus:ring-2 focus:ring-[#4f46e5] focus:ring-offset-2 focus:ring-offset-white">View components</a>
</div>
<div className="mt-12 flex flex-wrap justify-center gap-10">
<div>
<p className="text-2xl font-bold text-slate-900">12k+</p>
<p className="text-sm text-slate-500">teams</p>
</div>
<div>
<p className="text-2xl font-bold text-slate-900">99.99%</p>
<p className="text-sm text-slate-500">uptime</p>
</div>
<div>
<p className="text-2xl font-bold text-slate-900">4.9/5</p>
<p className="text-sm text-slate-500">rating</p>
</div>
</div>
</div>
</section>
);
}
More Tailwind components for React
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 React
Create a React project with Vite, then add Tailwind CSS v3:
npm create vite@latest my-app -- --template react
cd my-app
npm install
npm install -D tailwindcss@3 postcss autoprefixer
npx tailwindcss init -pSet content: ['./index.html', './src/**/*.{js,jsx}'] in tailwind.config.js, and add to src/index.css:
@tailwind base;
@tailwind components;
@tailwind utilities;The brand color is applied with arbitrary values such as bg-[#4f46e5], so no theme configuration is needed.
Use the hero section in React
// App.jsx
import HeroSection from './HeroSection';
export default function App() {
return <HeroSection />;
}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. The glass style relies on backdrop-filter, supported in all current browsers; place it over a colorful background for the best effect.
Compatibility
| Item | Details |
|---|---|
| CSS framework | Tailwind CSS v3.4+ |
| Library | React 18+ (function component) |
| Interactive state | None (static markup) |
| Dark mode | Yes — toggle in the editor |
| Style | Glassmorphism (backdrop blur) |