Collection doors two doors — Storefront block
Prostorefront-collection-doors-two-doors · for home pages
Collection doors two doors
Two collections side by side with one rule they share (new and classics, new and second-hand)
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-doors-two-doorsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontCollectionDoorsTwoDoors from '@/components/trame/blocks/storefront/storefront-collection-doors-two-doors.vue'
const props = {
title: "Featured this fall",
subtitle: "Two ways to dress for the season ahead.",
bands: [
{
id: "automne",
eyebrow: "Fall collection",
title: "The season’s warm pieces",
text: "Wool, fleece and heavy cotton, cut for layering. Sweater sizes go fast; the collection changes in January.",
image: "https://images.unsplash.com/photo-1673712060934-34358642511b?w=1600&q=80",
alt: "Olive jackets hanging from a rail",
action: "category",
count: 56
},
{
id: "classiques",
eyebrow: "The classics",
title: "What doesn’t change",
text: "The models we make again every year, in the same cuts and the same materials.",
image: "https://images.unsplash.com/photo-1512436991641-6745cdb1723f?w=1600&q=80",
alt: "A rack of shirts and jackets in soft colors",
action: "category",
count: 19
}
],
note: "New or refurbished, all our pieces come with a two-year warranty.",
options: {
unit: "models"
}
}
</script>
<template>
<StorefrontCollectionDoorsTwoDoors v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe section’s title ("Featured") |
| subtitle | string | Wordsone sentence under the title |
| bands* | Band[] | Datathe collections to open, two usually; four at most |
| note | string | Wordsone line shared by all the collections, under them ("New or second-hand: same guarantee") |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Band bands[] · 8 props
| Prop | Type | Description |
|---|---|---|
| id | string | number | Datathe band’s id |
| eyebrow | string | Wordswhat kind of collection it is ("Autumn collection", "New arrivals"), only if true |
| title* | string | Wordsthe collection’s name |
| text | string | Wordsone or two sentences on what is in it and why |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the picture shows |
| action | string | Actionthe page action the collection opens |
| count | number | Datahow many products the collection holds, from the catalogue |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| unit | string | Wordswhat a count counts ("models") |
| 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 |
|---|---|---|
| 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:
bands[] - Reads
categoriesfrom your app
A storefront section, for home pages; it uses @lucide/vue, @vueuse/core, clsx, motion, tailwind-merge.
More storefront blocks
- 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 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.
- Collection banner: a wide picture with the title card overlapping its edge: a collection with a strong picture or a campaign.
- 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.
- Collection feature magazine: a collection told like a magazine page: a pull quote, an italic line, highlights; for an edit with a point of view.
- Collection feature split stats: a collection with its facts beside the picture: price range, number of pieces, brands.