Collection banner split — Storefront block

Pro

storefront-collection-banner-split · for catalog pages

Collection banner split

The words on one half and the picture filling the other to the screen’s edge, the sub-categories as a ruled index with their counts: a collection with a tall picture and several sub-categories to jump to

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-collection-banner-split

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontCollectionBannerSplit from '@/components/trame/blocks/storefront/storefront-collection-banner-split.vue'

const props = {
title: "Bags and luggage",
trail: [
{
label: "Home",
action: "home"
},
{
label: "Leather goods",
action: "collection",
record: {
id: "maroquinerie"
}
}
],
description: "Bags made to last: coated canvas, full-grain leather, hand-stitched in our Portland workshop. Every model comes with its care guide and can be repaired for life.\n\nA tote for the day, a messenger for the city, a backpack for weekends: find the one that goes everywhere with you.",
count: 48,
image: "https://images.unsplash.com/photo-1473188588951-666fce8e7c68?w=1600&q=80",
alt: "A brown leather messenger bag, worn soft at the edges, resting on a block of stone",
children: [
{
id: "cabas",
name: "Totes",
count: 12
},
{
id: "besaces",
name: "Messenger bags",
count: 9
}
],
open: "collection",
options: {
eyebrow: "Leather goods",
unit: "products"
},
current: "besaces"
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe collection’s name ("Bags and luggage")
trailTrail[]the path to this page, from the home page; the last step is the collection itself
descriptionstringWordsthe merchant’s own words about the collection; paragraphs are separated by a blank line. Long text is clamped with "Read more"
countnumberDatathe real number of products in the collection
imagestringPicturea banner picture for the collection
altstringWordsthe picture’s description, when it shows something the words do not
childrenChildren[]Datathe sub-categories to jump to, as chips
currentstring | numberDatathe id of the sub-category shown now, if any
openstringActionthe page action a sub-category opens; it receives the category
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Trail trail[] · 3 props
PropTypeDescription
label*stringWordsthe words on the button or link
actionstringActionthe page action this step leads to; the last step is the current page and has none
recordRecord<string, unknown>Datathe record the action applies to, passed to the host with it, if any
Children children[] · 6 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
Options options · 4 props
PropTypeDescription
eyebrowstringWordsover the title ("Collection", "Autumn")
unitstringWordswhat the count counts ("products")
linesnumberlines of description shown before "Read more", 3 by default
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
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: trail[], open
  • Reads categories from your app

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

More storefront blocks

  • Checkout returning: a signed-in customer with a saved address and card: one card of rows, each editable alone, then one pay button.
  • Checkout stepped: a long form or a phone: three steps, finished ones folded to a one-line recap with "Edit".
  • Choice guide if then list: a situation, then the option the merchant recommends and why: product selectors and gift guides.
  • Choice guide size cards: one card per size or variant with its picture, dimensions and what it holds: choosing a size.
  • Clothing rail: the pieces hang sideways on one drawn rail and turn to face the visitor on hover or focus, their neighbours swinging aside; a phone shows one piece at a time: a fashion shop’s new pieces or a short edit, 3 to 12 of the merchant’s own products, best with cut-out pictures of each piece on its own hanger (hanger "none"); a plain photo shot on white melts into a light page. No frame round the pictures.
  • Collection doors two doors: two collections side by side with one rule they share (new and classics, new and second-hand).
  • Collection feature bands alternating: two to five collections told one after the other, the picture changing side, each with its sub-rows and prices.
  • Collection feature edit card: one collection promoted as a card: its picture, a sentence, three pieces and one button.

All 409 storefront blocks