Cosmero docsPre-release

Before and after

3 min read

Before and after shows two photos of the same subject in one frame, cut at a divider. The before photo shows to the left of the divider and the after photo to the right. Shoppers drag the divider, or tap the photo, to see more of one or the other. Add a heading, a text and the product the photos show. Use it on the home page or on a product page.

The divider works with a mouse, a finger and the keyboard. On a phone it moves once a finger goes sideways, so swiping up and down still scrolls the page. The arrow keys, Home and End move it too, and screen readers announce the split, such as “Before 50%, After 50%”. If a browser runs no JavaScript, both photos show side by side with their labels.

Online Store → Themes → Customize

  1. In your Shopify admin, go to Online Store → Themes and select Customize on Cosmero.
  2. At the top of the theme editor, open the template you want to change, such as the home page or a product template.
  3. In the sidebar, select Add section.
  4. Choose Before and after.
  5. Add both photos, then select Save.

You can add it to any template, but not to the header or the footer.

  • Layout: Image beside text (the default) puts the photos in one panel and your text in another. Image only shows the photos on their own, with your text above them and the product below.
  • Media position on desktop: Left (the default) or Right. On mobile the photos sit above the text. Shown when Layout is Image beside text.
  • Image ratio: the shape of the frame: Square, Portrait (4:5, the default) or Landscape (3:2). Both photos are cropped to it.
  • Starting position: where the divider starts, measured from the left edge, from 0 to 100% (default 50%).
  • Image: the before photo. Use real, unretouched photos of the same subject, taken in the same light and framing. 1600 x 2000px .jpg recommended.
  • Label: the badge in the top left corner of the photo. Leave it empty to show “Before”.
  • Image: the after photo, taken like the before photo.
  • Label: the badge in the top right corner of the photo. Leave it empty to show “After”.
  • Heading: the section’s heading.
  • Text: the text under the heading.
  • Product: the product the photos show. Leave it empty to show no product.
  • Show product as: Card (the default) shows a small product card with an add button. Link shows a text link: “Shop” and the product’s name.
  • Join panels: shows the image and the text as one panel, with no gap between them. Shown when Layout is Image beside text.
  • Color scheme: the colors of the text panel, or of the whole section with Image only. You edit color schemes in Theme settings.
  • Media color scheme: shows behind the image while it loads and when there is no image. Shown when Layout is Image beside text.
  • Panel style: Panel is a rounded panel inside the page margin. Flush spans the full page width with square corners.
  • Enable full width on mobile: on mobile, the panel runs from edge to edge with square corners. Shown when Panel style is Panel.
  • Top padding: space above the content, from 0 to 120 px.
  • Bottom padding: space below the content, from 0 to 120 px. On mobile, both paddings are scaled down: 64 px becomes 40 px.
  • Set the same focal point on both photos, so they still line up at the divider when the frame crops them.
  • Add alt text to both photos (in Content → Files in your Shopify admin). The section uses it, so screen readers can describe each photo.
  • If your photos are illustrations rather than real results, say so in the text.

Still stuck? We answer.

Contact support