Finder — Hero block

Pro

hero-finder · for home, landing, product pages

Finder

A product choice that needs a few questions: the first question shown, the real finder one click away

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-finder

Usage

Its demo data, shortened (Using blocks).

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

const props = {
title: "The first run of our travel bag, on preorder while it lasts",
subtitle: "One hundred fifty pieces sewn by hand, shipped in order of reservation. You only pay a deposit today.",
points: [
{
title: "Hand-sewn",
text: "One person makes it, from cutting to final inspection."
},
{
title: "Refundable",
text: "Cancel anytime before it ships."
}
],
primaryAction: {
label: "Preorder · $189",
action: "product",
record: {
id: "sac-voyage"
}
},
secondaryAction: {
label: "See details",
action: "page",
record: {
id: "details"
}
},
question: {
text: "What kind of trip are you looking for a bag for?",
answers: [
"A weekend in the city",
"A week, carry-on only"
],
step: 1,
steps: 3
},
options: {
eyebrow: "Numbered series",
note: "Comparison made by us from the product sheets of three bags sold in big-box stores."
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe offer’s promise, in a sentence
subtitlestringWordswhat it is and how it works, in one or two sentences
pointsPoint[]the points shown, in order
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
question*Questionthe finder’s first question and its answers
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Point points[] · 2 props
PropTypeDescription
title*stringWordsa reason, a few words
textstringWordsone line to back it
PrimaryAction primaryAction · 3 props
PropTypeDescription
label*stringWordswhat happens ("Preorder · €189")
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 ("Preorder · €189")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
Question question · 4 props
PropTypeDescription
text*stringWordsthe question the finder asks first
answers*string[]Wordsone answer
stepnumberwhich question this is, from 1
stepsnumberhow many questions the finder has
Options options · 4 props
PropTypeDescription
eyebrowstringWordsa short chip above the title
notestringWordsthe footnote, under the first question
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
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
  • Reads products from your app

A hero section, for home, landing, product pages; it uses @lucide/vue, @vueuse/core, 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

  • Event date led: the date in very large numerals beside the title and place, one picture band beneath: a one- or two-day event.
  • Event poster: the title set as a poster over a picture, the details in a ruled strip below: a festival, an exhibition, a season.
  • Event replay on demand: a past event: a one-line recap and the replay action, never a register button; without a replay it is the recap alone.
  • Figures stat band: a number is the argument: a bordered band of three to five figures the merchant states.
  • Float deck: the title set on the left and the pictures fanned on the right like a hand of cards, the first product in front: 2 to 4 products with one to lead, a more personal, collected opening.
  • Float orbit: the title above, the pictures in a gentle arc under it, the middle one largest: 2 to 4 products, a calmer opening.
  • Float scatter: the pictures around the title at different sizes and depths, as if set down on a table: 3 or 4 products that read well alone.
  • Flows workflow tabs: a product explained by its flows: centred words over a tab row, each tab a short chain of steps.

All 102 hero blocks