Skip to content
React & Tailwind

Build hero sections with React and Tailwind

How to build convincing hero areas with React and Tailwind CSS: structure, typography, image use and subtle animation with framer-motion.

9 min readUpdated: 10 July 2026
ReactTailwindHeroPerformance
Eyebrow01
Series 04
Light that stays all day
Six lamps from one workshop in Utrecht.
See the rangeShowroom

The hero is your page's first impression. In a few seconds it decides whether visitors stay. This guide shows how to build a hero with React and Tailwind CSS that loads fast, communicates clearly and convinces with calm motion.

The short version
  • A hero answers three questions right away: what this is, why it matters to you and what you do next.
  • Structure beats effect. Layout and typography first, motion after.
  • The hero image is usually the largest element on the page and decides your loading time.
  • Motion guides the eye. A fade and a short move upwards are almost always enough.
01

What a good hero has to do

A hero answers three questions right away: what this is, why it matters to me and what I do next. Everything else is secondary.

Keep the text block short. A clear headline, one or two sentences of explanation and one unmistakable action are enough. Too many options paralyse the decision.

01

What is it?

Eyebrow and headline say in one glance what is on offer here.

02

Why should I care?

Two sentences that name the benefit. Not the company history.

03

What should I do next?

One action, clearly emphasised. Everything else is a text link.

Focused
  • "Websites for medical practices, live in four weeks"
  • One button, a text link next to it
  • Two sentences that back the headline up
Overloaded
  • "Digital solutions for tomorrow"
  • Three buttons side by side
  • One paragraph with five sentences

Every question has its place in the hero. Drop one and you owe the answer somewhere else.

02

Structure with Tailwind

A centered grid with generous spacing covers most heroes. More important than the classes is that the type size grows with the width, otherwise you need a separate rule for every device.

<section className="   px-6">  <div className="mx-auto flex     flex-col      ">    <p>Eyebrow</p>    <h1>Headline</h1>    <p>Two sentences</p>    <div className="flex ">      <a>Book a call</a>      <a>Work</a>    </div>  </div></section>

Point at a highlighted class to see where it applies in the preview.

Five classes decide the whole structure. Everything else is content.

<h1  className="font-display font-semibold leading-[1.04]"  style={{ fontSize: "clamp(2rem, 5vw, 4rem)" }}   Websites für Arztpraxen, in vier Wochen live</h1>
clamp handles the size itself: minimum, preferred, maximum.
Cap the reading widthCap the paragraph below the headline at roughly 42 to 78 characters. Without a limit it runs across the whole page on large screens and stops being readable.
03

Images and loading time

If you use a background image it is almost always the largest element in the first viewport and therefore decisive for the Largest Contentful Paint. Serve it in a modern format, at the right size and with high priority.

hero-praxis.webpready for LCP
Format
WebP
Size
142 KB
Dimensions
1600 × 1000
Loading
priority
alt
set
JPEG, 2400 px1,8 MB
WebP, 1600 px142 KB

Five values decide whether the hero image carries the page or slows it down.

<img  src="/heros/praxis.webp"  alt=""  fetchPriority="high"  decoding="async"  className="h-full w-full object-cover"/>
Three attributes decide how fast the page feels.
loading lazy does not belong in the heroFor images further down it is right. In the first viewport it delays exactly the image everyone is waiting for.

Great heroes remove decisions.

Three arrangements that work. Which one fits is decided by the imagery, not by taste.

SplitText left, image right.
CenteredOne axis, short lines.
EditorialDeliberately off centre.
04

Subtle animation with framer-motion

Motion should guide the eye, not distract. A gentle fade of the headline on load is usually enough. Skip long distances and fast changes.

initial
opacity 0, y 12
animate
opacity 1, y 0
duration
0.5 s
ease
cubic-bezier(.22, 1, .36, 1)
stagger
80 ms

Twelve pixels of travel and half a second. A hero needs no more.

The same motion, just started with an offset. The switch shows what reduced motion does.

<motion.h1  initial={{ opacity: 0, y: 12 }}  animate={{ opacity: 1, y: 0 }}  transition={{ duration: 0.5, ease: [0.22, 1, 0.36, 1] }} 
An offset of 0.08 seconds per element is enough for the effect.
Ask for reduced motionuseReducedMotion gives you the system setting. Show the final state right away instead of just speeding the animation up.
05

Mistakes we keep seeing

Most weak heroes do not fail on the technical side, they fail on a decision nobody made.

  1. Three equal buttons. Offering everything recommends nothing. One primary path, at most a second one as a text link.
  2. A headline that only names the industry. Name what you do and who for. The rest goes further down.
  3. An image that only fills space. If the motif is interchangeable it is ballast. More whitespace beats an arbitrary stock photo.
  4. Motion for its own sake. Everything wobbling at once holds nobody.

If your hero stops working without the image, the text was the problem.

06

How to go about it

Building goes faster if you work in this order instead of deciding everything at once.

  1. Write the headline first. No layout, just one sentence. If it works bare, it works set as well.
  2. Set the text on the grid. Sizes via clamp, cap the reading width, keep spacing generous.
  3. Add the image. As WebP, at the right size, with high priority. Only then think about effects.
  4. Put the motion on top. A fade and a few pixels upwards, staggered. Then check it once with reduced motion.

If you would rather not start from zero: the library holds finished hero sections built exactly this way, as source code to drop in.

Share
Written by
Amelie RoesmannCreative directionLeonie RoesmannDesign engineering

We build websites and web apps at Systra Studios in Münster and put the building blocks from that work here. What you read comes from real projects, not from a brochure.

Systra Studios: web design from Münster

You know the principles.
Now skip the setup.

Production-ready hero sections in React, Tailwind and framer-motion. Copy, swap the copy, keep building.

  • 219 sections, heroes among them.
  • One file per component, three dependencies.
  • Motion, reduced motion and dark mode are built in.
Browse hero sections
FAQ

Frequently asked questions

Two lines on desktop, three on mobile. If you need more, you have usually packed two statements into one sentence. Split them: one becomes the headline, the other the paragraph below.

Didn't find your question? We're happy to help.

Get in touch