question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request- Built-in image component

See original GitHub issue

Feature request

Is your feature request related to a problem? Please describe.

Working with images is clearly a complicated job. There are many edge cases to deal with and it get complex over times with all additional formats.

Also, there are a lot of things that can be done (optimisation, display resizing, a11y, etc.

My own “in house” solution were:

They did grow complicated over time and covered the following features:

  • Optional link (is the image within a link element?)
    • Caring about security (noopener, etc.)
    • Caring about internal link vs external link (next/link vs a)
  • Min/max width/height allowed for this image (i.e: Image in nav/footer shouldn’t be bigger than X for proper display, image in product list should respect ratio but be always 150px width, etc.)
  • Handle SVG differently

Some specialised libraries have been created

I’d like to know if Next.js intends to build something dedicated to Next.js, such as gatbsy has some gatsby-image

Describe the solution you’d like

A Next.js official built-in or lib for handling images

Describe alternatives you’ve considered

The above mentioned libs.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
KidkAroliscommented, Jun 9, 2020

I have been working on something to solve this for myself that might be of interest: https://github.com/humaans/next-img/. I agree, this is a fairly complicated area when developing sites with Next.js, I hope next-img can be of use to others or provide feedback to a potential native Next.js implementation.

0reactions
balazsorban44commented, Jan 29, 2022

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building an effective Image Component - Chrome Developers
An image component encapsulates performance best practices and provides an out-of-the-box solution to optimize images.
Read more >
Basic Features: Image Optimization - Next.js
The Next.js Image component, next/image , is an extension of the HTML <img> element, evolved for the modern web. It includes a variety...
Read more >
Provide image component similar to next/image · Issue #42765
Feature Request Relevant Package @angular/image Description Since version 10.0.0, Next.js has a built-in Image Component and Automatic Image ...
Read more >
Nextjs image optimization with examples - Refine Dev
NextJS introduced a solution for delivering performant images on the web in v.10. It features a new Image component and built-in automatic image...
Read more >
`next/image` vs `react-datocms` Image - Feature requests
js). I love using react-datocms Image component because it makes image responsiveness so easy, but it seems to me that next/image offers ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found