Skip to content

Block 74 of 297

Shop Categories

Gift shop departments as an asymmetric photo mosaic, the first tile large, each with a name, item count and link.

Puck key
ShopCategoriesBlock
Export
shopCategoriesBlock
React component
<ShopCategories />
Path
components/puck/shop-categories-block.tsx
Dependencies
None
License
MIT

About this block

When to use it, how to write for it, and what to change in the code.

What it's for

Shop departments laid out as a photo mosaic, with the first category as a large feature tile and the rest filling in around it. Each tile is one link showing the category name and item count over a dark scrim. The feature tile also carries a short line. On phones the tiles stack, and tablets show two columns with the feature tile spanning both.

  • The landing page of a museum or park gift shop
  • A merchandise section on a membership or visit page
  • A store home page that sends people to departments rather than single products
Writing the content
  • Put your strongest category first; it gets the large tile and is the only one showing the Short line.
  • Five or seven categories fill the desktop mosaic evenly; one to seven are allowed.
  • Keep Item count short or bind it to your data. Image alt text can usually stay blank.
Accessibility
  • Each tile is a single link containing a heading, so screen-reader users hear the category name and count together, and headings sit one level below the section heading.
  • Text sits on a gradient plus a translucent dark band over the photo to help keep white text readable (WCAG 1.4.3); check contrast against very bright images.
  • The whole tile shows an indigo focus outline, and the arrow badge is hidden from assistive technology.
Customizing the code
  • Tile sizes for each count are set in the tileSpan function; edit it to change the mosaic pattern.
  • The scrim is bg-neutral-950/40 over a from-neutral-950 gradient covering the lower three quarters of each tile.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Eyebrowtext
  • Headingtext
  • Heading levelselect
  • Introtextarea
  • Categoriesarray
  • Link texttext
  • Link URLtext