Portrait — Hero block
Prohero-portrait · for home, landing pages
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.
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-portraitUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HeroPortrait from '@/components/trame/blocks/hero/hero-portrait.vue'
const props = {
eyebrow: "Wood-fired kitchen, Port Haven",
title: "One fire, one counter, and a menu that follows the farms",
subtitle: "Chef Ana Ruiz cooks every plate at Ember & Rye over oak and apple wood, for twenty-eight guests a night. Book the counter and watch the fire work.",
facts: [
{
label: "Where",
value: "The old smokehouse, Dock Street"
},
{
label: "Seats",
value: "Twenty-eight, and six at the counter"
}
],
portrait: "https://images.unsplash.com/photo-1769955821416-9273532bb148?w=1600&q=80",
logos: [
{
src: "https://placehold.co/160x48?text=Hollow",
alt: "Hollow Creek Farm"
},
{
src: "https://placehold.co/160x48?text=Combe",
alt: "Combe Creamery"
}
],
primaryAction: {
label: "Book the counter",
action: "contact"
},
secondaryAction: {
label: "See this week’s menu",
action: "work"
},
options: {
availability: "Counter seats free this Thursday",
portraitAlt: "A cook at the pass of a dark kitchen, seen through an opening",
factsTitle: "The room",
mood: "inverse"
}
}
</script>
<template>
<HeroPortrait v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordswho and where, in a few words ("Design studio, Lyon") |
| title* | string | Wordsthe name or the statement, in a sentence |
| subtitle* | string | Wordsone paragraph: what is done, for whom, how |
| facts | Fact[] | the facts shown, in order |
| portrait* | string | Picturethe owner’s portrait |
| logos | Logo[] | clients’ logos, the merchant’s own only |
| primaryAction* | PrimaryAction | the main button: its words and the page action it runs |
| secondaryAction | SecondaryAction | a quieter second action beside the main one: its words and the page action |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Fact facts[] · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the fact is ("Based in") |
| value* | string | Wordsits value, as the owner states it |
Logo logos[] · 2 props
| Prop | Type | Description |
|---|---|---|
| src* | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt* | string | Wordsthe client’s name |
PrimaryAction primaryAction · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Start a project") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
SecondaryAction secondaryAction · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Start a project") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Options options · 4 props
| Prop | Type | Description |
|---|---|---|
| availability | string | Wordsthe owner’s availability, in their words ("Available from January") |
| portraitAlt | string | Wordsthe portrait’s description |
| factsTitle | string | Wordsthe heading of the side card ("Awards", "Services") |
| 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:
primaryAction,secondaryAction
A hero section, for home, landing 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 cylinder: the promise centred above one row of pictures laid on the inside of a cylinder, flat at the centre and curling toward the visitor at both ends, streaming slowly sideways (a still curve below the expressive level): a studio or a product whose body of work is the argument and wants one striking, immersive picture rail rather than two plain rows (the merchant’s own work or products only).
- 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.
- 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.
- 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.