Collection pills hero banner — Storefront block
Prostorefront-collection-pills-hero-banner · for catalog pages
Collection pills hero banner
A full-bleed picture with the large title over it and the sub-collections as pills on its lower edge: an outdoor or fashion collection page
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-pills-hero-bannerUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontCollectionPillsHeroBanner from '@/components/trame/blocks/storefront/storefront-collection-pills-hero-banner.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-1643038233773-8c43a9a57f70?w=1600&q=80",
alt: "A traveller waiting on an empty station platform, a tan leather backpack in hand",
children: [
{
id: "cabas",
name: "Totes",
count: 12
},
{
id: "besaces",
name: "Messenger bags",
count: 9
}
],
open: "collection",
subcollections: [
{
label: "Totes",
action: "collection",
record: {
id: "cabas"
}
},
{
label: "Messenger bags",
action: "collection",
record: {
id: "besaces"
},
active: true
}
],
options: {
eyebrow: "Leather goods",
unit: "products"
}
}
</script>
<template>
<StorefrontCollectionPillsHeroBanner v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe collection’s name ("Bags and luggage") |
| trail | Trail[] | the path to this page, from the home page; the last step is the collection itself |
| description | string | Wordsthe merchant’s own words about the collection; paragraphs are separated by a blank line. Long text is clamped with "Read more" |
| count | number | Datathe real number of products in the collection |
| image | string | Picturea banner picture for the collection |
| alt | string | Wordsthe picture’s description, when it shows something the words do not |
| children | Children[] | Datathe sub-categories to jump to, as chips |
| current | string | number | Datathe id of the sub-category shown now, if any |
| open | string | Actionthe page action a sub-category opens; it receives the category |
| subcollections | Subcollection[] | the sub-collections as pills,; without it, the `children` take their place |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Trail trail[] · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe words on the button or link |
| action | string | Actionthe page action this step leads to; the last step is the current page and has none |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
Children children[] · 6 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe category’s name |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the category’s picture shows |
| count | number | how many products it holds |
| summary | string | Wordsone short line on the category |
Subcollection subcollections[] · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe sub-collection’s name ("Down jackets") |
| action* | string | Actionthe page action it opens |
| record | Record<string, unknown> | Datathe record the action opens, if any |
| active | boolean | whether this pill is the page shown now |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsover the title ("Collection", "Autumn") |
| unit | string | Wordswhat the count counts ("products") |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a 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).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| asset | a picture’s address as your app serves it |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your 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:
| Key | English | French |
|---|---|---|
| collection.readLess | Show less | Réduire |
| collection.readMore | Read more | Lire la suite |
| collection.sub | Sub-categories | Sous-catégories |
| collection.trail | Breadcrumb | Fil d’Ariane |
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too 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,subcollections[] - Reads
categoriesfrom your app
A storefront section, for catalog pages; it uses @lucide/vue, clsx, motion, tailwind-merge.
More storefront blocks
- Collection feature split stats: a collection with its facts beside the picture: price range, number of pieces, brands.
- Collection feature stacking cards: collections as large cards that pile up under each other as the page scrolls: two to five collections told one on top of the next.
- Collection header centered: everything centred under the breadcrumb, large title: a short, curated collection or a brand’s page.
- Collection header plain: the title on the left and the merchant’s description on the right, then the sub-category chips: the calm top of a large catalogue.
- Collection poster overlay: a full-bleed picture with the collection’s name set huge over it and its pieces in a ribbon along the bottom: the season’s one big statement.
- Collection spec sheet hero then specs: a technical collection: an opening picture, one grid of every product, the merchant’s figures and a quote they supplied.
- Collection story alternating split: a brand family or a maker series: picture and words swap sides chapter after chapter, a product strip under each.
- Collection story chapters with rail: a seasonal or campaign edit told in full-width picture chapters, each followed by its three or four products.