Product slides framed card — Hero block
Prohero-product-slides-framed-card · for home pages
Product slides framed card
A rounded frame inside the page’s margins, the words at its top left and the product card floating at the bottom right with the arrows beside it: a quieter shop, or a header that never overlays
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/hero-product-slides-framed-cardUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HeroProductSlidesFramedCard from '@/components/trame/blocks/hero/hero-product-slides-framed-card.vue'
const props = {
slides: [
{
image: "https://images.unsplash.com/photo-1721932423849-e9033192b190?w=1600&q=80",
alt: "A bright living room: an armchair, a gray sofa and a coffee table in front of two tall windows",
title: "A living room that breathes",
text: "Wood, wool and plants: few things, chosen to last.",
action: {
label: "See the living room",
action: "collection",
record: {
id: "salon"
}
},
product: {
id: "vase-fleurs-sechees",
name: "Dried flower bouquet with vase",
price: 4200,
image: "https://images.unsplash.com/photo-1713191352960-911f277876a7?w=600&q=80",
alt: "A vase of dried flowers on a light background",
rating: 4.7,
reviewCount: 38
}
},
{
image: "https://images.unsplash.com/photo-1714836986273-9a62b37f55fa?w=1600&q=80",
alt: "A wooden table set with two gray plates and dish towels",
title: "The table, simply",
text: "Stoneware, linen and glasses you use every day.",
action: {
label: "See tableware",
action: "collection",
record: {
id: "table"
}
},
product: {
id: "theiere-blanche",
name: "White porcelain teapot",
price: 5600,
compareAt: 6400,
image: "https://images.unsplash.com/photo-1683558654439-8b9986cbf1dd?w=600&q=80",
alt: "A white teapot on a woven tablecloth",
badge: "Handmade"
}
}
],
options: {
eyebrow: "Home collection"
}
}
</script>
<template>
<HeroProductSlidesFramedCard v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| slides* | Slide[] | 1 to 5 campaigns, each with its product; nothing turns by itself |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Slide slides[] · 6 props
| Prop | Type | Description |
|---|---|---|
| image* | string | Picturethe campaign’s scene, wide; loaded only when its slide is reached |
| alt | string | Wordswhat the picture shows (empty: decorative) |
| title* | string | Words3 to 8 words; the first slide’s is the page’s h1 |
| text | string | Wordsone sentence |
| action | Action | the slide’s call to action: its words and the page action |
| product* | Product | Datathe one product this campaign leads to, from the catalogue tool; its rating and badge are the shop’s own only |
Action slides[].action · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("See the collection") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens (a collection), if any |
Product slides[].product · 10 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe product’s name |
| price* | number | an amount in cents |
| compareAt | number | the price before the merchant’s reduction |
| currency | string | DesignISO 4217, EUR by default |
| image | string | null | Picturethe main picture; null or absent: the product has none yet |
| alt | string | Wordswhat the main picture shows |
| badge | string | Wordsa short tag the merchant set ("New", "Handmade") |
| rating | number | the average of the shop’s own stored reviews |
| reviewCount | number | how many stored reviews the rating averages |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short line above every title ("House collection") |
| 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 |
| money | formats a price, given in cents |
| 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:
slides[].action - Reads
productsfrom your app
A hero section, for home pages; it uses @lucide/vue, clsx, motion, tailwind-merge.
More hero blocks
- Photo request: a tall picture with the form panel overlapping it: a workshop, a venue or a service whose place sells the request.
- Portrait: a person-led brand: the portrait with an availability dot beside the intro, the clients’ logos passing under it at the expressive level (a still row below it) — the merchant’s own only.
- Preorder: a limited run in preorder: the price and deposit, how many are reserved, and the production timeline.
- Product introduction stats grid: four figures the merchant states in a bordered grid: a track record is the argument.
- Product introduction steps: an ordered list of what happens first: a product that is easy to start with — the merchant’s own only.
- Profile facts: a studio or freelancer opening: who, what and a few key facts, with the recognitions they earned in a card beside — the merchant’s own only.
- Project inquiry split form: someone who wants to be written to: the key facts on one side, a short contact form on the other — the merchant’s own only.
- Projects numbered: a portfolio led by its work: a short intro and a numbered list of projects with their discipline and year — the merchant’s own only.