Skip to main content
Web app skills · Lesson 12 of 12 · 12 min

Codex ImageGen Lab for a Responsive Next.js Hero

Build a responsive Next.js hero with a supplied Codex ImageGen asset, verify the image crop and HTML booking action, and compare both language layouts.

By Matthews WongReviewed on

Key takeaway

A responsive Next.js hero combines an image whose subject survives cropping with HTML copy and a reachable action. In this lab you reuse a bicycle-workshop image generated with Codex ImageGen, then check a mobile and desktop booking layout in English and Indonesian. You can complete the layout exercise with the supplied asset.

You will be able to

  • Translate a website image brief into a crop decision.
  • Check responsive image delivery and keyboard reachability on both locales.
Watch it work

Step through the diagram

Press Play, or step with the arrows. Every step is written out below the diagram.

Codex ImageGen Lab for a Responsive Next.js Hero

A responsive Next.js hero combines an image whose subject survives cropping with HTML copy and a reachable action. In this lab you reuse a bicycle-workshop image generated with Codex ImageGen, then check a mobile and desktop booking layout in English and Indonesian. You can complete the layout exercise with the supplied asset.

Reviewed on 3 December 2026

Step 1 of 5. Find the mechanic’s hands and the bicycle’s gears in the supplied image.

Keys: ← → step · Home / End · K play or pause

  1. Find the mechanic’s hands and the bicycle’s gears in the supplied image.

  2. Use a sized container and let the copy wrap as normal HTML.

  3. Compare the narrow hero to the desktop view. Use the longer Indonesian heading for the layout check.

    Predict the next step What keeps the booking button adaptable across locales? (The source file extension · A larger image export · HTML copy and a native link)
  4. Press Tab until the main action receives focus, then activate it and inspect the destination.

  5. Use the browser network panel to confirm a mobile image request fits the layout.

Prepare the image and HTML

Open the flagship comparison to see the 1200×800 workshop image. The hands and drivetrain establish what the shop does. In your layout, use the image as a visual beside a heading and a booking link to a section within the same page.

Read more (1)

If ImageGen is available in your Codex surface, try generating a second version from the saved brief in the article. The supplied asset remains available for practising the same implementation and browser checks.

Inspect mobile first, then compare desktop

Start at 390 CSS pixels and check whether the mechanic’s hands and the booking action remain legible. Try both languages at the same width before comparing a desktop viewport.

How this site does it

The real config behind this lesson

Excerpts from the repository that builds and deploys this website, quoted as they are.

lib/blog-figures.ts
  "codex-imagegen-bicycle-workshop": {
    src: "/images/blog/inline/codex-imagegen-bicycle-workshop.jpg",
    width: 1200,
    height: 800,

The live article uses this source and intrinsic size. Reuse that path in your lab before adjusting the way the image fits its container.

What breaks

Mistakes that cost real time

  • The phone crop loses the repair

    Adjust object position or provide a separate crop. Capture the new phone view and confirm the gear and wrench are visible.

  • The booking link is visible but hard to reach

    Tab through the headline region and ensure the native link receives a visible focus indicator and leads to the booking section.

Try it yourself

Do it on your own machine

Use a local Next.js checkout. The article contains the exact asset and can be opened in both languages while you work.

  1. Create a scratch page at app/[locale]/(pages)/imagegen-lab/page.tsx. Build a hero with the supplied asset and a booking link to a section with id booking. Supply “Book a bicycle service” in English and “Jadwalkan servis sepeda Anda” in Indonesian.

  2. Start the local server. Open /en/imagegen-lab and /id/imagegen-lab at 390 and 1280 CSS pixels. Capture the crop and activate the booking link with a keyboard.

    npm run dev
  3. Use the network panel at 390 pixels to inspect the resource selected for Next.js Image. Compare it after changing sizes to reflect the actual layout.

Quick quiz

Three questions before you move on

Pick an answer to see why it is right or wrong. Nothing is graded, so guess freely; a miss is kept in this browser so the course can ask it again later.

  1. 1.What keeps the booking button adaptable across locales?
  2. 2.Where should the mobile crop be checked?
  3. 3.What does sizes describe to the browser?
From earlier lessons

Two questions from earlier lessons

Recalling an older lesson after a gap is what makes it stick. Answer from memory before you look anything up.

  1. 1.Which condition makes the log step run when an earlier step failed?
  2. 2.A visitor has prefers-reduced-motion set to reduce. What is the right response?

From: 11. Playwright Smoke Test in GitHub Actions: Serve, Wait, Fail · 9. Web Accessibility Basics for Beginners in a Next.js Site

Think it through

Answer in your head, then check

  1. 1.Where should the mobile crop be checked?Show the answer

    Answer:The page’s aspect ratio and object position determine what the phone displays.

  2. 2.What does sizes describe to the browser?Show the answer

    Answer:The approximate display width helps the browser choose a source candidate for its viewport.

Go deeper

Related deep dives on this site

Sources

Primary sources checked on the research date. Follow them for the current version.