Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

The image component shrinks the width and height to fit everything into the screen width not making it scrollable

As the number of items increases, the image shrinks. How can I make sure the image’s width and height are 500px and make sure it scrolls horizontally?

<ul className="flex flex-row w-screen overflow-x-auto">
  {data.map((item, index) => (
    <li key={index} className="w-500">
      <Image src={data.pic} width={500} height={500} alt="" />
    </li>
  ))}
</ul>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Add shrink-0 to the list items to prevent the items from shrinking. So something like:

<li className="w-500 shrink-0">
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading