Skip to content

Size guide

A size picker with a modal guide: a measurement table and a size recommended from the chest measurement, in one click.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

Under the size buttons of a clothing page, the “Size guide” link opens a modal window: a measurement table (chest and waist for each size) and a small calculator where you type your chest measurement. The recommended size shows at once (“For 99 cm we recommend size L”) and a button selects it directly on the page while closing the window; beyond the table, the message says so honestly. The window is a native dialog element opened with showModal: trapped focus, closing with Escape, the button or a click on the backdrop, and focus returned to the opening link. Sizes are real radio buttons in a fieldset, and adding to cart checks that a size is chosen and announces it in a role="status" region. Table with caption and headers, scrollable on small screens; measurements described in JSON in an attribute. 44 px targets, AA contrast in light and dark mode, no animation.

Code

Loading the code…

The code of this component in

Archive contents

guide-des-tailles-html-tailwind.zip3 files · 6 Ko

  • index.html12 Ko
  • README.md4 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

  • A limited-time offer bar: countdown to a fixed date, one-click copyable promo code and a fallback message once the offer is over.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A sales card showing the discount that grows with the cart amount (-10% from €50, -15% from €100…) with a progress bar towards the next tier.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A Christmas gift guide filtered by budget and theme, with the number of ideas announced and an empty state offering to show everything again.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • The last order dates for delivery before Christmas, per shipping method, with the days left worked out from the visitor’s date.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component