Portrait — Hero block

Pro

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

Usage

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.

PropTypeDescription
eyebrowstringWordswho and where, in a few words ("Design studio, Lyon")
title*stringWordsthe name or the statement, in a sentence
subtitle*stringWordsone paragraph: what is done, for whom, how
factsFact[]the facts shown, in order
portrait*stringPicturethe owner’s portrait
logosLogo[]clients’ logos, the merchant’s own only
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
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Fact facts[] · 2 props
PropTypeDescription
label*stringWordswhat the fact is ("Based in")
value*stringWordsits value, as the owner states it
Logo logos[] · 2 props
PropTypeDescription
src*stringPicturea picture: a root-relative path (/media/…) or an absolute URL
alt*stringWordsthe client’s name
PrimaryAction primaryAction · 3 props
PropTypeDescription
label*stringWordswhat happens ("Start a project")
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 ("Start a project")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
Options options · 4 props
PropTypeDescription
availabilitystringWordsthe owner’s availability, in their words ("Available from January")
portraitAltstringWordsthe portrait’s description
factsTitlestringWordsthe heading of the side card ("Awards", "Services")
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 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.

All 102 hero blocks