A fashion store product detail screen built with Tailwind CSS: swipeable product photos with dots, price and rating, colour swatches, size chips with a size guide bottom sheet, a details accordion and a sticky Add to bag bar. It is an HTML mobile template for mobile websites and PWAs and can be packaged as a native app with Capacitor. Use it as the product page of a clothing app or boutique shop.
How it works
The root .fpd-app is a phone-width column. The gallery [data-fpd-gallery] is a horizontal scroll-snap row of .fpd-slide figures; a debounced scroll listener in script.js moves aria-current between the .fpd-dot buttons, the dots scroll to their photo, and the arrow keys move between photos when the gallery has focus.
Colour and size are native radio groups inside fieldsets. Choosing a swatch updates [data-fpd-color-label] and scrolls the gallery to the slide whose data-fpd-slide matches the radio value.
Add to bag ([data-fpd-add]) checks for a size first. Without one it shows "Please select a size." in [data-fpd-size-error], outlines the chips and moves focus to the size group. With a size it raises the bag badge and shows a toast. The Size guide button opens #fpd-guide, a native <dialog> bottom sheet with a measurement table that highlights the chosen size and switches between cm and inches from the data-cm values. The sheet closes with Escape or a backdrop tap. The accordion uses <details class="fpd-acc">.
Customization
--fpd-inkand--fpd-ink-presson.fpd-appinstyle.css: colour of the Add to bag button, selected size chip and focus rings.aspect-ratioon.fpd-slide: change6 / 7to3 / 4for taller photos.- Add a colour by copying a
.fpd-swatchlabel with a newvalueanddata-fpd-name, plus a.fpd-slidewith the samedata-fpd-slide. - Add or remove the
disabledattribute on a size radio to mark sizes as sold out. - Edit the
data-cmvalues in.fpd-tableto match your own size chart; inches are calculated. font-familyon.fpd-app: replace Manrope and update the Google Fonts URL.- Replace the bag counter update in the Add to bag click handler with
fetch()to your cart API.
Use cases
- Clothing and fashion apps: a product page with sizes, colours and a size chart.
- Boutique and brand stores: an editorial mobile product page for coats, dresses or knitwear.
- Shoe and accessory shops: reuse the size chips for EU or US shoe sizes.
- Marketplace PWAs: a mobile-first product detail screen before checkout.
Accessibility
The gallery uses aria-roledescription="carousel" and labelled slides, the dots are buttons with labels, and the radio groups have legends. The size error is linked with aria-describedby and announced through aria-live. The wishlist and unit buttons use aria-pressed, the size guide is a labelled modal <dialog> and focus returns to its trigger. Animations respect prefers-reduced-motion.
Usage notes
The photos come from Unsplash; replace them with your own product images. Bootstrap Icons and Manrope load from CDNs.