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.