🎤 Builder Talk: The Story Behind Lady Gaga’s Digital Experience – Register now

What's the Best Way to Do Images in Next.js?

11 replies
Last updated: May 6, 2021
what is the “best” way right now to do images in Next.js that supports hotspots, cropping etc? Particularly interested in a list page with images that are all the same size/proportion and deliver all the right browser layout hints. Any examples?
May 6, 2021, 3:29 PM
May 6, 2021, 3:29 PM
I also don’t quite understand how to handle responsive images, where they are different sizes etc for different devices
May 6, 2021, 3:47 PM
user M
I actually roll my own photo component to handle images and account for hotspots/cropping/etc. from Sanity
May 6, 2021, 5:50 PM
May 6, 2021, 5:50 PM
curious why this general topic seems not well established.. did you also jsut not find anything that checked all the boxes of “give me an image that fits correctly in this hole and respects the crop I set”?
May 6, 2021, 5:51 PM
Yea exactly, nothing really checked all the boxes, and I wanted full control over the image experience
May 6, 2021, 5:54 PM
is hull.dev powered by this? Looks really nice, I might have to borrow this 😬
May 6, 2021, 5:55 PM
It is! 😊
May 6, 2021, 5:57 PM
damn, I’m going to be spending lots of time in this repo. Wish I wasn’t migrating an existing site
May 6, 2021, 5:57 PM
Good luck!
May 6, 2021, 5:57 PM
huh interesting. I suppose it’s mostly agnostic to the framework in use. I’ll see how this goes. I actually use very few image types/styles so I don’t need a hugely comprehensive solution
May 6, 2021, 6:38 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?

Related answers

Get more help in the community Slack

TopicCategoriesFeaturedRepliesLast Updated
How to turn PortableText into plain text in Javascript?Dec 7, 2020
Deploying Next JS on VercelJan 20, 2021
Rendering nested block contentJan 18, 2021
In the tutorial, there is samples of what the API returns as JSON. Is there a way to view these ?Jan 11, 2021
DOMParser is not defined at defaultParseHtmlDec 3, 2020
Warning: Data for Page Exceeds the Threshold of 128 kBAug 17, 2022
Custom Document Views - Is it Even Possible to Use the Structure Builder?Apr 21, 2022
Error in Next.js tutorial with event handlers in server components.Feb 28, 2024
GraphQL query resolving references on a _raw field in GatsbyMay 17, 2022
How to populate a list of values in a Sanity schema using a separate fileSep 6, 2021

Related contributions

Turbo Start Sanity
- Template

The battle-tested Sanity template that powers Roboto Studio's websites

Go to Turbo Start Sanity

Schema UI - Next.js Sanity Starter
- Template

A Next.js starter template with Next.js 15, Tailwind CSS, shadcn/ui, and Sanity CMS with Live Editing. Get production-ready React components with matching Sanity schemas and queries. Build dynamic pages faster while keeping full control over customization.

Serge Ovcharenko
Go to Schema UI - Next.js Sanity Starter

The Swaddle
- Made with Sanity

A new brand identity to represent a more mature company, to signify The Swaddle’s evolution from publisher to production house, combined with an easier to navigate platform that can surface multiple content types - drawing readers through The Swaddle’s content offering.

Nightjar
Go to The Swaddle