Project portfolio Browse selected work

Shopify Plus Upgrade Monthly Fee Reduction + Up to $4800 Development Fee Credit - Exclusive WesWoo Offer

Search
Home, collections and trust
Choose module

Collection tabs

From the first tab press End then Right. Compare focused tab, selected tab and visible panel after both moves.

Switch from a nondefault tab by keyboard, reload and go Back. Check the expected focus, panel and URL states separately from the sample’s one keypress.

The visible panel and focused link changed together. A page that changes content while leaving focus on the old tab would produce a mismatch.

Reproduce the test and inspect the readings

With two collections, focus the first and send Home or End. Read visible panel / focused link.

In the order above
p1 / #p1 then p2 / #p2

WESWOO ran this entry’s published script in standalone Chrome with the fixture markup and records described here.

2026-11-24 · Chrome 157.0.8103.79 · assets/ww-series-tabs.js

Download test conditions and raw readings (JSON)

Inspect the source and verification point

assets/ww-series-tabs.js · line 21

    if (event.key === 'ArrowRight') next = (index+1)%tabs.length;
    else if (event.key === 'ArrowLeft') next = (index+tabs.length-1)%tabs.length;
    else if (event.key === 'Home') next = 0;
See the WESWOO test and results

Open the file and focus Desk. Press the keys in order. After each key, compare the focused tab with the single visible collection heading.

Key sequenceFocus / visible panel
EndFloor / Floor lamps
RightDesk / Desk lamps
LeftFloor / Floor lamps
HomeDesk / Desk lamps

This run used three fixed panels with the keyboard handler active. Verify the product-to-collection mapping separately in the integrated store.

Download the HTML used in this test and open it in a browser

WESWOO · 2026-11-24 · Chrome 157.0.8103.79 · Published example code with isolated test data

How the module works

Observed result

Pressing End from the first lamp collection moved both focus and content to Floor. Right then wrapped to Desk. Checking both reveals a tab that changes its highlight but leaves the old products on screen.

Treat each collection as a complete panel

Select a collection per section block and keep its image, title, selection_summary and destination in one panel. Change them together when another collection is chosen, without borrowing missing content from the previous group.

Use both section.id and block.id in identifiers so each control finds its own panel. Render all panels in reading order before initialization, with usable anchors. Scripting improves access rather than supplying otherwise unavailable information.

Keep selection, focus and panels aligned

Call bindSeriesTabs(root) after loading the module; exporting a function does not initialize it. Enhancement synchronizes aria-selected, tabindex and panel visibility, with arrow keys and Home and End moving within the collection set.

Visit the last group and return to the first, reading its name and following the collection link. A second section should not affect the first. Clean up bindings on editor reload to avoid repeated handling; without scripting, the ordinary content remains readable.

Example source code

View 2 source filesLIQUID · JS
snippets/ww-series-tabs.liquid
<section data-ww-series-tabs aria-label="Choose a collection">
  <nav data-ww-series-controls aria-label="Collections">
  {% for block in section.blocks %}{% assign item = block.settings.collection %}
    {% if item != blank %}<a id="SeriesTab-{{ section.id }}-{{ block.id }}" href="#SeriesPanel-{{ section.id }}-{{ block.id }}" data-ww-series-tab>{{ item.title | escape }}</a>{% endif %}
  {% endfor %}
  </nav>
  {% for block in section.blocks %}{% assign item = block.settings.collection %}
    {% if item != blank %}
    <section id="SeriesPanel-{{ section.id }}-{{ block.id }}" data-ww-series-panel aria-labelledby="SeriesTab-{{ section.id }}-{{ block.id }}" {{ block.shopify_attributes }}>
      <h2>{{ item.title | escape }}</h2>
      {% if item.image != blank %}{{ item.image | image_url: width: 1000 | image_tag: loading: 'lazy' }}{% endif %}
      <p>{{ item.metafields.custom.selection_summary.value | escape }}</p>
      <a href="{{ item.url | escape }}">Explore {{ item.title | escape }}</a>
    </section>
    {% endif %}
  {% endfor %}
</section>

Integration and checks

Integration steps

3 steps
  1. Configure the collection panels

    Configure collection blocks and render all panels.

  2. Connect the tabs

    Call bindSeriesTabs(root) and retain the current theme tab styling.

  3. Test reloads and keyboard use

    Clean up before section reload and verify touch, keyboard and no-script paths.

Data and dependencies

  • Each section block has a collection setting.
  • IDs include section.id and block.id; positioning uses selection_summary on the collection.

Interaction and states

  • Before enhancement every panel is readable through anchors.
  • Enhancement synchronizes selection, tabindex and visibility, including arrows and Home/End.

Before launch

State feedback
StateTriggerOutcome
Readable sequenceInitialization succeedsActivate the first panel
A collection selectedClick or navigation keySwitch the complete collection panel
Script unavailableFollow anchorAll collections remain readable

Use the fragment with a real block schema. Its exported initializer must be called by the section entry script.

Sources and further reading

Scope and licensing

Educational implementations for Shopify themes and Headless projects. Confirm real inputs, interaction states and existing components in a development theme before store acceptance. Missing task-specific WESWOO articles remain unlinked.

Shopify/dawnLicenseShopify-integration theme license; architecture reference without copying the implementation. · 3e9ee2281dc4Shopify/hydrogenLicenseMIT; retain copyright and license when using substantial code. · 9e358a2462ba

References checked · 2026-11-24