Enhance Your Shopify Product Pages: Adding Desktop Image Navigation in Dawn Theme

Hey there, fellow store owners! As a Shopify migration expert and someone who spends a lot of time sifting through community discussions, I often come across common pain points that can really impact a customer's shopping experience. One such topic recently popped up in the forums, brought to us by @EternitySparkles, and it's something many of you might relate to: how to add those handy 'next' and 'previous' arrows to your product images on desktop.

EternitySparkles was looking for a way to let customers scroll through product pictures on their desktop site, much like the swiping functionality already present on mobile. They're using the popular Dawn theme, specifically version 15.3.0, which is super helpful context for finding the right solution. They even shared a screenshot, which always makes things clearer:

First Steps: No-Code Options & Theme Settings

Before diving into code, it's always smart to check for built-in solutions or app integrations. @SectionKit brought up a couple of great points:

  • Check your Dawn Theme Settings: Head over to your Online Store > Customize > Product Page. You might find a setting for a "media viewer" there. Newer versions of Dawn are constantly adding features, so it's worth a look! If you find a setting that enables image navigation, that's your easiest win.
  • Explore the App Store: SectionKit also suggested a "smart product slider" app. The Shopify App Store is a treasure trove of solutions. While apps can sometimes add complexity or monthly costs, they often provide robust features without needing any coding expertise. If you're not comfortable with code, this is a solid route to explore.

For those who prefer a more custom, hands-on approach and want to avoid extra apps, the community had an excellent code-based solution.

The DIY Approach: Adding Navigation Arrows with Code

This is where @rajweb stepped in with a detailed, step-by-step guide for Dawn 15.3.0.1 (which is very close to EternitySparkles' 15.3.0). This solution involves adding some HTML for the buttons, CSS for styling them, and JavaScript to make them functional. It's a fantastic way to get precisely what you want without relying on third-party apps.

Important Note: Before making any changes to your theme code, always, always, always duplicate your theme! This creates a backup you can revert to if anything goes wrong. You can do this by going to Online Store > Themes, finding your current theme, clicking "Actions," and then "Duplicate."

Step 1: Add the Arrow Buttons (HTML)

You'll need to add the actual button elements to your product media gallery. This code should be placed within the section/main-product.liquid file, specifically inside the gallery container.



Step 2: Style the Arrows (CSS)

Next, let's make those arrows look good and position them correctly. Add this CSS code to your assets/base.css file, or alternatively, place it within the section of your theme.liquid file (though base.css is generally the cleaner spot for styling).

.product-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 2px solid #d9534f;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  z-index: 5;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prev-arrow {
  left: 15px;
}

.next-arrow {
  right: 15px;
}

@media screen and (max-width: 749px) {
  .product-gallery-arrow {
    display: none;
  }
}

This CSS snippet does a few things:

  • It positions the arrows absolutely, centered vertically.
  • Gives them a nice circular shape with a border and background.
  • The @media screen and (max-width: 749px) rule ensures these arrows only appear on desktop, hiding them on smaller screens where touch swiping is already present, which is exactly what EternitySparkles asked for!

Step 3: Make the Arrows Work (JavaScript)

Finally, we need JavaScript to tell the buttons what to do when clicked. This script will scroll the product image slider left or right. Add this code before the closing tag in your theme.liquid file, or if you prefer a more organized approach, in a custom JavaScript file linked in your theme.

document.addEventListener('DOMContentLoaded', () => {
  const slider = document.querySelector('.product__media-list');
  const prevBtn = document.querySelector('.prev-arrow');
  const nextBtn = document.querySelector('.next-arrow');

  if (!slider || !prevBtn || !nextBtn) return;

  nextBtn.addEventListener('click', () => {
    slider.scrollBy({
      left: slider.clientWidth,
      behavior: 'smooth'
    });
  });

  prevBtn.addEventListener('click', () => {
    slider.scrollBy({
      left: -slider.clientWidth,
      behavior: 'smooth'
    });
  });
});

This script listens for clicks on your new 'previous' and 'next' buttons. When clicked, it smoothly scrolls the main product media list (`.product__media-list`) by the width of the slider itself, effectively moving to the next or previous image.

Other Community Insights

It's worth noting that other community members, like @Mustafa_Ali and @devcoders, asked for the store URL and password. This is a common and helpful practice in the forums because sometimes, the exact solution depends on the specific setup or other customizations already present on a store. For truly bespoke help, sharing access can be crucial.

@tim_tairli also linked to another helpful thread concerning adding a main image slider, suggesting there are often multiple paths to similar outcomes within the Shopify ecosystem.

Bringing It All Together

So, whether you're looking for a quick app solution, a potential theme setting, or you're ready to roll up your sleeves with some code, the Shopify community has got your back. Adding these simple navigation arrows can significantly improve the desktop browsing experience for your customers, making it easier for them to explore all your beautiful product images. The code provided by Rajat is a solid, direct answer for Dawn theme users looking to implement this feature themselves. Just remember to back up your theme, test thoroughly, and enjoy a more polished product page!

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases