Preorder — Hero block
Prohero-preorder · for home, landing, product pages
Preorder
A limited run in preorder: the price and deposit, how many are reserved, and the production timeline
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-preorderUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HeroPreorder from '@/components/trame/blocks/hero/hero-preorder.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"
}
},
offer: {
price: 18900,
deposit: "$30 deposit today, the balance when it leaves the workshop. Refundable until it ships.",
claimed: 96,
total: 150,
unit: "pieces reserved",
separateLabel: "Bought separately",
bundleLabel: "Kit price",
savingLabel: "You save"
},
timeline: [
{
label: "Reservations open",
detail: "While the series lasts",
state: "done"
},
{
label: "Cutting and assembly",
detail: "March",
state: "current"
}
],
options: {
eyebrow: "Numbered series",
note: "The deposit is refunded if the series doesn’t launch. The balance is charged when it ships.",
panelTitle: "How production is going"
}
}
</script>
<template>
<HeroPreorder 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 |
| offer | Offer | the offer: its price and what it includes |
| timeline | Timeline[] | the preorder’s steps, in order, e.g. "Production" |
| 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 |
Offer offer · 8 props
| Prop | Type | Description |
|---|---|---|
| price* | number | the price in cents (preorder: the full price; kit: the bundle price) |
| deposit | string | Wordsthe deposit and refund terms, in the merchant’s words ("€30 deposit today, refundable until shipping") |
| claimed | number | how many are reserved: the shop’s real count |
| total | number | how many exist in the run |
| unit | string | Wordswhat is counted ("copies reserved") |
| separateLabel | string | Wordsthe line for the pieces bought one by one ("Bought separately") |
| bundleLabel | string | Wordsthe line for the bundle price ("Kit price") |
| savingLabel | string | Wordsthe line for the saving ("You save") |
Timeline timeline[] · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe step ("Production") |
| detail | string | Wordsits date or its detail, as the merchant gives it |
| state* | string | Designdone, current or upcoming |
Options options · 5 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short chip above the title |
| note | string | Wordsa footnote under the buttons: the terms of the preorder, as the merchant states them |
| panelTitle | string | Wordsthe heading of the panel ("Where the making stands") |
| 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 |
| money | formats a price, given in cents |
| 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
- 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.
- 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.
- 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.
- Product slides fullbleed card: pictures edge to edge, the words on the calm side and the campaign’s product on a card at the other, arrows at the edges: a shop whose scenes sell and whose first click should land on a product.