Recently viewed products

  • Section
  • recently-viewed
  • Beauty
  • Shopify Liquid ready
  • 15 KB JS

Products the visitor viewed recently. Part of Shelf, a beauty theme for multi-brand clean beauty retailer, in the free, open-source Blocko library.

Open live demo Open in library

Features

  • Ships 15 KB of vanilla JavaScript (blko-pdp.js), registered as an idempotent Custom Element.
  • Ships as Shopify Liquid, with 4 merchant settings in the Theme Editor.
  • Category recently-viewed. Made for beauty stores.
  • Recently viewed handles are kept in localStorage and loaded from /products/<handle>.js; the chosen collection is the server-rendered fallback.

Used in pages

This section appears in 1 page template in Shelf:

Preview

Recently viewed products preview

Use it with your agent

Paste this one-line prompt into any coding agent. It asks where the section should go before it changes anything.

Use the Blocko library (https://github.com/blockoai/blocko) or its Claude Code plugin (claude plugin marketplace add blockoai/blocko && claude plugin install blocko-sections@blocko) to implement the section "Recently viewed products" in my project. Id `pdp-recently-viewed`, theme `shelf`. Live demo: https://demo.blocko.ai/html/shelf/sections/recently-viewed--pdp-recently-viewed.html. Shopify bundle: sections/shelf/pdp-recently-viewed/ in the repo. Before changing any code, ask me where it should go: which project/theme, which page or template, and the position (e.g. after the hero). Also ask if the target is a Shopify theme or plain HTML. Skip anything I've already said. Restate the plan and wait for my OK, then follow the repo's AGENTS.md. Keep the blko- class prefix and CSS tokens (with fallbacks), make custom elements idempotent, and don't touch unrelated code. Run `shopify theme check` for Shopify targets. Finish by telling me how to add/arrange it (Theme Editor steps for Shopify).

Connected to the Blocko MCP server (https://blocko.ai/mcp)? Ask your agent to run get_item for shelf/pdp-recently-viewed, then get_item_source and get_install_guide. Connect your agent.