Photo request — Hero block

Pro

hero-photo-request · for home, landing pages

Photo request

A tall picture with the form panel overlapping it: a workshop, a venue or a service whose place sells the request

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-photo-request

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import HeroPhotoRequest from '@/components/trame/blocks/hero/hero-photo-request.vue'

const props = {
title: "A quote for your custom order within 48 hours",
lead: "Tell us what you’re looking for: the workshop replies by email with a price, a lead time and a leather swatch.",
fields: [
{
name: "name",
label: "Name",
type: "text",
placeholder: "Camille Martin",
required: true
},
{
name: "email",
label: "Email address",
type: "email",
placeholder: "[email protected]",
required: true
}
],
submitLabel: "Get my quote",
formAction: "quote.request",
consent: "Your answers are used only to prepare this quote and are deleted after three months.",
points: [
"A reply from a craftsperson, not a bot",
"Free quote, no commitment"
],
images: [
{
src: "https://images.unsplash.com/photo-1628483211662-9bcc692c46dc?w=1600&q=80",
alt: "A cognac leather card holder, spools of thread and leatherworking tools on a workbench"
},
{
src: "https://images.unsplash.com/photo-1787005241178-c9006ea9610b?w=1600&q=80",
alt: "Hands trace a pattern in pencil on leather"
}
],
options: {
eyebrow: "Quote on request",
formTitle: "Your request"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe promise, in one sentence ("A quote for your workshop in 48 hours")
leadstringWordsone or two sentences on what happens after sending the form
fieldsField[]the form’s fields, in order
submitLabel*stringWordswhat the button does ("Get my quote")
formAction*stringActionthe page action that receives the form (posted by it)
consentstringWordswhat the answers are used for and the right to leave, as the merchant states it, under the button
pointsstring[]Wordsone thing the visitor gets or knows after sending, as the merchant states it
images*Image[]one to three pictures beside the request
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Field fields[] · 6 props
PropTypeDescription
name*stringDesignthe field’s name as the page action receives it ("email", "company", "message")
label*stringWordswhat the field asks ("Email address")
type'email' | 'text' | 'tel' | 'textarea' | 'select'the kind of field; text by default
placeholderstringWordsan example of the answer, not an instruction
requiredbooleantrue: the form is not sent without it
choicesstring[]Wordsone choice of a select, as the merchant words it
Image images[] · 2 props
PropTypeDescription
src*stringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the picture shows, when the words do not say it
Options options · 5 props
PropTypeDescription
eyebrowstringWordsa short line above the title ("On quote")
formTitlestringWordsthe heading of the form’s panel ("Your request")
status'success' | 'error'Datathe answer to the last submission, when the host re-renders with it
statusTextstringWordswhat that answer says
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
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: formAction

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

More hero blocks

  • Marquee columns side: the promise on the start side, beside two or three columns of pictures scrolling slowly up and down in opposite directions (still below the expressive level, a short still grid on a phone): a studio, a maker or a shop whose body of work is the argument and wants its words read first, the pictures as a living gallery beside them (the merchant’s own work or products only).
  • 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.
  • 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.

All 102 hero blocks