A collection tabs section for Shopify: pill-shaped tabs for up to four collections, each with its own product grid, sale prices and a View all link. Use it on the home page to show new arrivals, best sellers and current offers in the space of one section. Copy section.liquid into your theme's sections folder and add it from the theme editor as "WDS Collection tabs".
How it works
Each tab is a block that points to a collection. The section renders every tab's products on the server, so switching tabs is instant and needs no extra requests. Product cards show the featured image, title and price. When a product has a compare-at price above its price, the card shows a Sale badge, the sale price and the struck-through regular price. Sold out products get a Sold out badge, and products with variant prices start with "From".
The grid has four columns on desktop and two on mobile by default. On narrow screens the tab row scrolls sideways, and the selected tab scrolls into view. Below each grid, a View all link goes to that tab's collection.
Until a collection is chosen, a tab shows sample cards with placeholder images, so the section looks complete as soon as you add it. When you select a tab block in the theme editor, that tab opens.
Customization
In the theme editor:
- Heading, Subheading and Heading and tabs alignment (left or center).
- Products per tab, Columns on desktop, Columns on mobile and Image shape (square, portrait or landscape).
- Show vendor and Show "View all" link.
- Collection and Tab label on each tab block. An empty label uses the collection title.
- Labels: View all, Sale badge, Sold out badge, the price prefix and the hidden screen reader texts.
- Background, Text, Accent (active tab), Active tab text, Card and tab background and Sale price and badge colors.
- Side padding, Top padding and Bottom padding.
Accessibility
The tabs follow the WAI-ARIA tabs pattern: a tablist with tab buttons and tabpanel regions, aria-selected and roving focus. Left and Right arrow keys move between tabs, Home and End jump to the first and last, and Tab moves into the products. Sale and regular prices have hidden labels for screen readers, the View all link names its collection, every control has a visible focus outline, and hover effects are turned off for people who prefer reduced motion.
Usage notes
This section requires an Online Store 2.0 theme and inherits the theme's fonts.
The preview uses an invented store with photos from Unsplash; on your store the cards show your own products and images. Its links go nowhere.
Each tab shows the first products of its collection in the collection's sort order, up to Products per tab (max 12). All tabs are in the page from the start, so keep the product count moderate on a busy home page. Without JavaScript, only the first tab is visible. Badge text is white, so choose a dark enough sale color.