Next.js Discord

Discord Forum

Intrinsic vs rendered dimensions

Unanswered
Nick posted this in #help-forum
Open in Discord
I'm sure there's an obvious explanation for this and I've completely misunderstood, but I'm just finding the docs a little confusing tbh.

On the width and height properties: https://nextjs.org/docs/pages/api-reference/components/image#width

The width property represents the rendered width in pixels, so it will affect how large the image appears.

You could argue that represents and affects imply that it doesn't technically set the properties directly, but this feels like confusing language given that it definitely can be interpreted that way (and probably is)

Elsewhere the docs have a description that, at least in my understanding, better fits: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#width

The width and height attributes are used to infer the correct aspect ratio of image and avoid layout shift from the image loading in. The width and height do not determine the rendered size of the image file

Have I completely misunderstood?

Thanks,
Nick

0 Replies