Type centered — Hero block
Freehero-type-centered · for home, landing pages
Type centered
Centred, the pictures under it in a row whose middle one stands taller: a launch, a calmer brand.
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-type-centeredUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HeroTypeCentered from '@/components/trame/blocks/hero/hero-type-centered.vue'
const props = {
title: "Clothes made for the {word}, every day.",
images: [
{
src: "https://images.unsplash.com/photo-1515886657613-9f3515b0c78f?w=1600&q=80",
alt: "A yellow tracksuit on a seaside basketball court"
},
{
src: "https://images.unsplash.com/photo-1512436991641-6745cdb1723f?w=1600&q=80",
alt: "A rack of shirts and jackets in soft colors"
}
],
text: "Cut in small batches in our workshop, repairable for life.",
action: {
label: "See the shop",
action: "catalog"
},
options: {
words: [
"city",
"mountains"
],
eyebrow: "Independent workshop"
}
}
</script>
<template>
<HeroTypeCentered v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe statement, 4 to 12 words; with options.words, "{word}" marks where the turning word goes, inside the sentence; without it the words are not shown |
| images | Image[] | one wide picture, or a strip of 3 to 5 small ones: the business’s own |
| text | string | Wordsone or two sentences under the statement |
| action | Action | the call to action: its words and the page action it runs |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Image images[] · 2 props
| Prop | Type | Description |
|---|---|---|
| src* | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the picture shows, when the words do not say it |
Action action · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("See the shop") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| words | string[] | Wordsthe turning word’s values, each true of the business, the first written by the server ("route", "trail", "trail") |
| eyebrow | string | Wordsa few words above the statement |
| 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:
action
A hero section, for home, landing pages; it uses 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
- Tour board below: the same promise centred, then a wide board across the whole window under it, toured the same way: a range to see as a whole first, wider than tall, for an opening that leads with the words (the host’s own work only).
- Tour board side: the promise at the start and, on the other side to the window’s edge, a flat masonry board of the host’s pieces that a camera tours at the expressive level (steps back, comes close on one, holds, moves on): a studio, a shop or a library whose range is the argument and wants the words read beside it (the host’s own work only).
- Trio split: the promise in its own column beside the products, the first one tall and the others stacked next to it, names and prices laid on the pictures: one lead product backed by one or two companions.
- Trio staggered: the promise above three featured products set at different heights: a small range the shop is proud of in full.
- Trusted logo strip: a B2B opening whose proof is who already uses it: the merchant’s own logos under a thin rule.
- Video ambient: the film plays by itself, muted and in a loop, behind the words at the foot of the first screen, with a pause button and a "Watch the film" button for the whole film with its sound: a place, a craft or a product in use, shown before it is told; a short file of a few MB, the merchant’s own film only.
- Video device side: the words beside a phone holding a vertical film, over a tinted disc: a mobile app, a reel or a portrait film; the merchant’s own film only.
- Video framed below: the words centred first, then a wide framed film that straightens as the page scrolls: a product or a service whose promise must be read before the film; the merchant’s own film only.