Finder — Hero block
Prohero-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-finderUsage
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.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe offer’s promise, in a sentence |
| subtitle | string | Wordswhat it is and how it works, in one or two sentences |
| points | Point[] | the points shown, in order |
| 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 |
| question* | Question | the finder’s first question and its answers |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Point points[] · 2 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsa reason, a few words |
| text | string | Wordsone line to back it |
PrimaryAction primaryAction · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Preorder · €189") |
| 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 ("Preorder · €189") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Question question · 4 props
| Prop | Type | Description |
|---|---|---|
| text* | string | Wordsthe question the finder asks first |
| answers* | string[] | Wordsone answer |
| step | number | which question this is, from 1 |
| steps | number | how many questions the finder has |
Options options · 4 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short chip above the title |
| note | string | Wordsthe footnote, under the first question |
| background | 'aurora' | 'pattern' | 'none' | the section’s background: aurora, pattern, none |
| 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 |
| 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 - Reads
productsfrom 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.