Image

Image converted to AVIF format and resized. AVIF compresses images significantly better than older-generation formats such as WebP and JPEG.

Displaying great product images is one of the most important keys to e-Commerce success.

You can choose the image format you need so that you do not unnecessarily load an image that is larger than the area in which you are displaying it. This ensures maximum page optimisation.

Use .img--overlay class for images on white background to make a layer with light grey overlay.

Small Image

.img--small

Image Alt
Image Alt
Image Alt
<div class="img--overlay img--4/3 img--small">
  <Image
    imageObject={
      {
        src: 'https://img.freepik.com/darmowe-wektory/tlo-retro-modeli-geometrycznych_52683-17902.jpg?w=1380&t=st=1706311337',
        alt: 'Image Alt',
        height: '180',
        width: '240',
        class: 'object-cover'
      }
    }
  />

  <div class="img--4/3 img--small">
    <Image
      imageObject={
        {
          src: 'https://img.freepik.com/free-photo/beautiful-green-landscape-with-plantations-trees-cloudy-sky_181624-42918.jpg?w=970&t=st=1706315168',
          alt: 'Image Alt',
          height: '180',
          width: '240',
          class: 'object-cover'
        }
      }
    />
  </div>

  <div class="img--4/3 img--small">
    <Image
      imageObject={
        {
          src: 'https://img.freepik.com/free-photo/lake-mountains_1204-508.jpg?w=970&t=st=1706315236',
          alt: 'Image Alt',
          height: '180',
          width: '240',
          class: 'object-cover'
        }
      }
    />
  </div>

  

</div>

Medium Image

.img--medium

Image AltImage AltImage Alt
  <a class="img--medium img--3/2 b-l b-white" href="#">
    <Image
      imageObject={
        {
          src: 'https://img.freepik.com/darmowe-wektory/tlo-retro-modeli-geometrycznych_52683-17902.jpg?w=1380&t=st=1706311337',
          alt: 'Image Alt',
          height: '180',
          width: '240',
        }
      }
    />
  </a>

  <a class="img--medium img--3/2 b-l b-white" href="#">
    <Image
      imageObject={
        {
          src: 'https://img.freepik.com/free-photo/beautiful-green-landscape-with-plantations-trees-cloudy-sky_181624-42918.jpg?w=970&t=st=1706315168',
          alt: 'Image Alt',
          height: '180',
          width: '240',
          class: 'bg-gray-100/70'
        }
      }
    />
  </a>

  <a class="img--medium img--3/2 b-l b-white" href="#">
    <Image
      imageObject={
        {
          src: 'https://img.freepik.com/free-photo/lake-mountains_1204-508.jpg?w=970&t=st=1706315236',
          alt: 'Image Alt',
          height: '180',
          width: '240',
          class: 'bg-gray-100/70'
        }
      }
    />
  </a>

Responsive Image with srcset

Image Alt
 <Image
      imageObject={
        {
          src: 'https://img.freepik.com/free-photo/beautiful-green-landscape-with-plantations-trees-cloudy-sky_181624-42918.jpg?w=1970&t=st=1706315168',
          alt: 'Image Alt',
          height: '1350',
          width: '1800',
          class: 'bg-gray-100/70',
          srcset: [430, 690, 960, 1200, 1800]
        }
      }
    />

Image Aspect Ratios

Image ratio, also known as aspect ratio, is how wide an image is in relation to how tall it is. For viewing on a mobile device, the recommended image ratio is 1:1 (a square picture).

Ready-made CSS classes:

  • img--1/1
  • img--2/3
  • img--3/1
  • img--3/2
  • img--3/4
  • img--4/3
  • img--16/9
Image Alt
1:1
Image Alt
3:1
Image Alt
4:3
Image Alt
3:2
Image Alt
16:9
Image Alt
3:4
Image Alt
2:3
  <div class="img--medium img--1/1 b-l b-white w-full">
    <Image
      imageObject={
        {
          src: 'https://img.freepik.com/free-photo/nature-beauty-tropical-rainforest-adventure-tranquility-freshness-generated-by-artificial-intellingence_25030-62539.jpg?size=960&ext=jpg',
          alt: 'Image Alt',
          height: '700',
          width: '700',
        }
      }
    />
  </div>

  <div class="img--medium img--3/1 b-l b-white w-full">
    <Image
      imageObject={
        {
          src: 'https://img.freepik.com/free-photo/nature-beauty-tropical-rainforest-adventure-tranquility-freshness-generated-by-artificial-intellingence_25030-62539.jpg?size=960&ext=jpg',
          alt: 'Image Alt',
          height: '700',
          width: '700',
        }
      }
    />
  </div>

  <div class="img--medium img--4/3 b-l b-white w-full">
    <Image
      imageObject={
        {
          src: 'https://img.freepik.com/free-photo/nature-beauty-tropical-rainforest-adventure-tranquility-freshness-generated-by-artificial-intellingence_25030-62539.jpg?size=960&ext=jpg',
          alt: 'Image Alt',
          height: '700',
          width: '700',
        }
      }
    />
  </div>

  <div class="img--medium img--3/2 b-l b-white w-full">
    <Image
      imageObject={
        {
          src: 'https://img.freepik.com/free-photo/nature-beauty-tropical-rainforest-adventure-tranquility-freshness-generated-by-artificial-intellingence_25030-62539.jpg?size=960&ext=jpg',
          alt: 'Image Alt',
          height: '700',
          width: '700',
        }
      }
    />
  </div>

  <div class="img--medium img--16/9 b-l b-white w-full">
    <Image
      imageObject={
        {
          src: 'https://img.freepik.com/free-photo/nature-beauty-tropical-rainforest-adventure-tranquility-freshness-generated-by-artificial-intellingence_25030-62539.jpg?size=960&ext=jpg',
          alt: 'Image Alt',
          height: '300',
          width: '300',
        }
      }
    />
  </div>

  <div class="img--medium img--3/4 b-l b-white w-full">
    <Image
      imageObject={
        {
          src: 'https://img.freepik.com/free-photo/nature-beauty-tropical-rainforest-adventure-tranquility-freshness-generated-by-artificial-intellingence_25030-62539.jpg?size=960&ext=jpg',
          alt: 'Image Alt',
          height: '700',
          width: '700',
        }
      }
    />
  </div>
  
  <div class="img--medium img--2/3 b-l b-white w-full">
    <Image
      imageObject={
        {
          src: 'https://img.freepik.com/free-photo/nature-beauty-tropical-rainforest-adventure-tranquility-freshness-generated-by-artificial-intellingence_25030-62539.jpg?size=960&ext=jpg',
          alt: 'Image Alt',
          height: '700',
          width: '700',
        }
      }
    />
  </div>

It is good to have all the images in the same ratio so that they look fairly uniform. Additionally, you can use a different ratio on desktop than on mobile view.

Image 1:1 on mobile, and 4:3 on desktop

Image Alt
<div class="img--medium img--1/1 md:img--4/3 b-l b-white w-full">
  <Image
    imageObject={
      {
        src: 'https://img.freepik.com/free-photo/nature-beauty-tropical-rainforest-adventure-tranquility-freshness-generated-by-artificial-intellingence_25030-62539.jpg?size=960&ext=jpg',
        alt: 'Image Alt',
        height: '700',
        width: '700',
      }
    }
  />
</div>