Product slides framed card — Hero block

Pro

hero-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-card

Usage

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.

PropTypeDescription
slides*Slide[]1 to 5 campaigns, each with its product; nothing turns by itself
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Slide slides[] · 6 props
PropTypeDescription
image*stringPicturethe campaign’s scene, wide; loaded only when its slide is reached
altstringWordswhat the picture shows (empty: decorative)
title*stringWords3 to 8 words; the first slide’s is the page’s h1
textstringWordsone sentence
actionActionthe slide’s call to action: its words and the page action
product*ProductDatathe 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
PropTypeDescription
label*stringWordswhat happens ("See the collection")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens (a collection), if any
Product slides[].product · 10 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
name*stringWordsthe product’s name
price*numberan amount in cents
compareAtnumberthe price before the merchant’s reduction
currencystringDesignISO 4217, EUR by default
imagestring | nullPicturethe main picture; null or absent: the product has none yet
altstringWordswhat the main picture shows
badgestringWordsa short tag the merchant set ("New", "Handmade")
ratingnumberthe average of the shop’s own stored reviews
reviewCountnumberhow many stored reviews the rating averages
Options options · 2 props
PropTypeDescription
eyebrowstringWordsa short line above every title ("House collection")
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: slides[].action
  • Reads products from 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.

All 102 hero blocks