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.
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
Keys: ← → step · Home / End · K play or pause
Find the mechanic’s hands and the bicycle’s gears in the supplied image.
Use a sized container and let the copy wrap as normal HTML.
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)Press Tab until the main action receives focus, then activate it and inspect the destination.
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)Show less
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.
The real config behind this lesson
Excerpts from the repository that builds and deploys this website, quoted as they are.
"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.
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.
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.
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.
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 devUse 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.
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.
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.
Answer in your head, then check
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.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.
Related deep dives on this site
Sources
Primary sources checked on the research date. Follow them for the current version.