Product introduction stats grid — Hero block

Pro

hero-product-introduction-stats-grid · for home, landing, app pages

Product introduction stats grid

Four figures the merchant states in a bordered grid: a track record is the argument

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-introduction-stats-grid

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import HeroProductIntroductionStatsGrid from '@/components/trame/blocks/hero/hero-product-introduction-stats-grid.vue'

const props = {
title: "Dress shoes you repair instead of throwing away",
subtitle: "Hand-stitched in our workshop and resoleable for ten years. Every pair comes back to us when it wears down.",
checklist: [
"Vegetable-tanned leather",
"Flat-rate resoling"
],
primaryAction: {
label: "Explore the collection",
action: "collection"
},
secondaryAction: {
label: "How it works",
action: "page",
record: {
id: "atelier"
}
},
rating: {
value: "4.8 / 5",
label: "based on our customers’ reviews",
avatars: [
{
name: "Customer 1",
alt: "A smiling customer"
},
{
name: "Customer 2",
alt: "A smiling customer"
}
]
},
panel: {
stats: [
{
value: "12,400",
label: "pairs repaired"
},
{
value: "10 years",
label: "average lifespan"
}
],
steps: [
{
title: "Choose your pair",
text: "Three lasts, eight leathers, half sizes included."
},
{
title: "We make it",
text: "Allow three weeks in the workshop."
}
]
},
options: {
eyebrow: "Made in the USA",
note: "Free shipping on orders over $100",
panelTitle: "Your first week"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe promise, in a sentence
subtitlestringWordswhat it is and for whom, in one or two sentences
checkliststring[]Wordsone thing the visitor gets, a few words
primaryAction*PrimaryActionthe main button: its words and the page action it runs
secondaryActionSecondaryActiona quieter second action beside the main one: its words and the page action
ratingRatingthe rating, as the merchant states it
panel*Panelthe panel beside the words: figures or a picture
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
PrimaryAction primaryAction · 3 props
PropTypeDescription
label*stringWordswhat happens ("Try for free")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
SecondaryAction secondaryAction · 3 props
PropTypeDescription
label*stringWordswhat happens ("Try for free")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
Rating rating · 3 props
PropTypeDescription
value*stringWordsthe rating as the merchant states it ("4.8 / 5")
label*stringWordswhat it rests on ("from 1,200 customer reviews")
avatarsAvatar[]a few real customers’ pictures beside the rating
Avatar rating.avatars[] · 3 props
PropTypeDescription
name*stringWordsthe avatar’s name
alt*stringWordswho the picture shows
srcstringPicturea picture: a root-relative path (/media/…) or an absolute URL
Panel panel · 2 props
PropTypeDescription
statsStat[]the panel’s stats, in order
stepsStep[]the panel’s steps, in order
Stat panel.stats[] · 2 props
PropTypeDescription
value*stringWordsthe figure as stated ("12,400")
label*stringWordswhat it counts
Step panel.steps[] · 2 props
PropTypeDescription
title*stringWordsthe step’s title
textstringWordsthe step’s text
Options options · 6 props
PropTypeDescription
eyebrowstringWordsa short chip above the title
notestringWordsfine print under the actions
panelTitlestringWordsthe heading of a steps or stats panel ("Your first hour")
flipbooleantrue: swaps the sides
background'aurora' | 'pattern' | 'none'the section’s background: aurora, pattern, none
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: primaryAction, secondaryAction

A hero section, for home, landing, app pages; it uses @lucide/vue, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.

Built with

The components this block is made of; each one installs on its own too.

More hero blocks

  • Marquee rows: the promise centred above two full-width rows of pictures sliding slowly in opposite directions (one row under six pictures), still below the expressive level: a studio, a maker or a shop whose body of work is the argument (the merchant’s own work or products only).
  • Ornament: a type-led opening with no integrations to show: the words at one corner of a large drawn object, purely decorative.
  • 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 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.
  • Product slides fullbleed card: pictures edge to edge, the words on the calm side and the campaign’s product on a card at the other, arrows at the edges: a shop whose scenes sell and whose first click should land on a product.
  • 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.

All 102 hero blocks