Category photo grid lead and two — Storefront block

Pro

storefront-category-photo-grid-lead-and-two · for home, catalog pages

Category photo grid lead and two

One tall lead tile beside two stacked: when exactly one category is the one to push

Documentation

Installation

One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).

pnpm dlx shadcn-vue@latest add @trame/storefront-category-photo-grid-lead-and-two

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontCategoryPhotoGridLeadAndTwo from '@/components/trame/blocks/storefront/storefront-category-photo-grid-lead-and-two.vue'

const props = {
title: "Shop by department",
subtitle: "Six departments to gear up for a trip, from the jacket to the campsite.",
tiles: [
{
id: "1",
name: "Jackets",
summary: "Windbreakers, puffers and rain jackets for every season.",
image: "https://images.unsplash.com/photo-1673712060934-34358642511b?w=1600&q=80",
alt: "Jackets, category preview",
count: 38,
priceFrom: 8900
},
{
id: "2",
name: "Shoes",
summary: "From Sunday strolls to mountain running.",
image: "https://images.unsplash.com/photo-1575987116913-e96e7d490b8a?w=1600&q=80",
alt: "Shoes, category preview",
count: 24,
priceFrom: 6500
}
],
open: "category",
allAction: "catalog",
options: {
unit: "models"
}
}
</script>

<template>
<StorefrontCategoryPhotoGridLeadAndTwo v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordsthe section’s title ("Shop by department")
subtitlestringWordsone sentence under the title, if it helps
tiles*Tile[]Datathe categories (or materials, occasions, recipients) to show, in the order to show them
openstringActionthe page action a tile opens; it receives the category
allActionstringActionthe page action of the "see all" link
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Tile tiles[] · 8 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
name*stringWordsthe category’s name
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the category’s picture shows
countnumberhow many products it holds
summarystringWordsone short line on the category
badgestringWordsa short tag the merchant set ("New"), only when it is true
priceFromnumberthe lowest price of the category in cents, computed from the catalogue
Options options · 3 props
PropTypeDescription
unitstringWordswhat a count counts ("models", "pieces"), written after the number
aspect'square' | 'portrait' | 'landscape'the pictures’ shape: square, portrait or landscape
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
What it asks your app for

The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
moneyformats a price, given in cents
asseta picture’s address as your app serves it
Linkyour router’s link component
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour word for an interface key, or undefined to keep the block’s own

The words it says itself, in English and French; label(key) replaces any of them:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo many attempts, try again in a moment.Trop de tentatives, réessayez dans un moment.

Features

  • Every word in the server HTML
  • Same markup in Vue and React
  • Theme tokens only: every theme, light and dark
  • Shows what you give it, invents nothing
  • Expressive motion, within its budget; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: open, allAction
  • Reads categories from your app

A storefront section, for home, catalog pages; it uses @lucide/vue, @vueuse/core, clsx, motion, tailwind-merge.

Built with

The components this block is made of; each one installs on its own too.

More storefront blocks

  • Category index alphabet: a long or picture-poor catalogue: every category as a link under its letter, from 3 to 60 of them.
  • Category index inline: a short catalogue of 3 to 20 categories set large in one flowing paragraph, each count raised after its name: a confident, type-led way in for a shop with few or no pictures.
  • Category index ladder: categories that differ on one measure (capacity, size, price band): a bar per row, proportional to the real value.
  • Category leaders: two to six categories with their lead product in a row: a way in by what each rayon is known for.
  • Category tabs accordion: stacked panels, one per category, the first open: fits phones and long category names best.
  • Category tabs sidebar: the categories as a column of large names held on the left, the chosen one’s products, rule and "see all" on the right: four to twelve categories on a wide screen, a department-store feel.
  • Category tabs: two to eight categories previewed in one place: a tab row over a few products, the rule and the "see all" link under them.
  • Category tiles arches: arch-topped pictures on a staggered baseline with the name and count under: a soft, boutique way into 3 to 8 categories.

All 409 storefront blocks