Skip to content

Size Guide Popup for Shopify

Shopify section: a Size guide link on product pages that opens an accessible dialog with a size chart from blocks, a cm / in toggle and how-to-measure notes.

Also known as: shopify size chart section, shopify size guide popup, size chart modal shopify, cm to inches size table

Preview with sample data

Open in new tab

Liquid code

A size guide popup for Shopify product pages. A "Size guide" link opens a dialog with a size chart built from blocks, a cm / in switch that converts every value, and a short note on how to measure, with an optional diagram. Use it for clothing or any product where fit questions lead to returns. Copy section.liquid into your theme's sections folder and add it from the theme editor as "WDS Size guide".

How it works

A link with a ruler icon opens a native HTML dialog with the chart. Each size row is a block with a size name and chest, waist and hip values in centimetres. Values can be single numbers or ranges such as 96-101. The inch values are calculated from them and rounded to the nearest half inch. A column is hidden automatically when every size leaves it empty.

The chosen unit is remembered on the shopper's device. On phones the dialog opens as a sheet from the bottom of the screen, and a wide table scrolls sideways inside its frame instead of widening the page.

In the theme editor the dialog opens when you select the section or a size block.

Customization

All of these are in the theme editor:

  • Link label, Text next to the link and Alignment.
  • Heading, Show product title, Intro and Close button (screen readers).
  • Size column, Chest column, Waist column and Hip column: the table headings.
  • Default unit, Centimetres label, Inches label, Note in centimetres and Note in inches.
  • How to measure heading, Text and an optional Image.
  • Size blocks with Size, Chest (cm), Waist (cm) and Hip (cm).
  • Link, Dialog background, Dialog text, Accent and Text on accent colors.
  • Side padding, Top padding and Bottom padding.

Accessibility

The native dialog element keeps focus inside the popup, closes with Escape and returns focus to the link. A click on the dimmed background also closes it. The unit switch uses buttons with aria-pressed, and the note above the table announces the active unit. The table has a caption, column and row headers, and its scroll area can be reached with the keyboard. Every control has a visible focus outline, and the opening animation is turned off for people who prefer reduced motion.

Usage notes

This section requires an Online Store 2.0 theme. Fonts come from your theme. Add it to your product template directly below the product information; it cannot be placed inside the theme's own product form.

The preview shows the dialog already open on an invented store page. The product photo comes from Unsplash; replace it with your own images. The sample sizes are a common unisex chart, not a standard: enter the measurements your products are actually cut to. One chart is shared by every product that uses the template, so create a separate product template for products with a different fit.

Size Guide Popup for Shopify at a glance

Framework
Shopify
Code
Liquid
JavaScript
Not needed
Dependencies
fonts.googleapis.com
Layout
Responsive, works on mobile
Category
Product Details
License
Free for personal and commercial use

Questions about this section

Can I use the Size Guide Popup for Shopify code for free?

Yes. You can copy or download the Liquid code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my Shopify store?

Create a new section named shopify-size-guide in your theme code editor, paste the Liquid code and save. Then add the section to a page in the theme editor. It works with Online Store 2.0 themes.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

How to install

  1. In your Shopify admin, go to Online Store > Themes, open the theme's menu and choose Edit code.
  2. Under Sections, add a new section named shopify-size-guide, replace its contents with the Liquid code above and save.
  3. Open the theme editor, choose Add section and add it to the page.

Requires an Online Store 2.0 theme. Try it on a copy of your theme first. WebDevSnippets is not affiliated with or endorsed by Shopify.

Size Guide Popup for Shopify – free Shopify product detail page template
Size Guide Popup for Shopify · free Shopify product detail page template

More Product Details

Bootstrap Product Page – free Bootstrap 5 product detail page template

Bootstrap Product Page

Bootstrap 5 product details page with image gallery, color and size pickers, quantity stepper, and tabs for description, specifications and customer reviews.

Product Detail with Gallery – free Tailwind CSS product detail page template

Product Detail with Gallery

Dark Tailwind CSS product page section with a thumbnail image gallery, finish options, quantity stepper and add to cart button with loading state.

Frequently Bought Together Section for Shopify – free Shopify product detail page template

Frequently Bought Together Section for Shopify

Shopify section that shows the current product with up to 3 picked products, checkboxes, variant selects, a live total and one button that adds everything checked to the cart.

Sticky Add to Cart Bar for Shopify – free Shopify product detail page template

Sticky Add to Cart Bar for Shopify

Shopify section: a bar fixed to the bottom of product pages that appears once the main add-to-cart button scrolls away, with image, price, variant select and a real product form.

Product Detail with Image Zoom Lens – free Tailwind CSS product detail page template

Product Detail with Image Zoom Lens

Tailwind CSS product detail section with a round magnifier lens that zooms the photo on hover or arrow keys, plus adjustable 2x to 4x levels.