Bundle kit — Hero block
Prohero-bundle-kit · for home, landing, product pages
Bundle kit
A bundle of two to five pieces: what is in it, what it costs bought apart, and what the kit saves
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-bundle-kitUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HeroBundleKit from '@/components/trame/blocks/hero/hero-bundle-kit.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"
},
items: [
{
id: 1,
name: "Waxed canvas backpack",
price: 14900,
image: "https://images.unsplash.com/photo-1602845860431-35374f24f48d?w=1600&q=80",
alt: "A mustard canvas backpack with leather straps, resting in the grass"
},
{
id: 2,
name: "Insulated bottle 25 oz",
price: 3500
}
],
options: {
eyebrow: "Numbered series",
note: "Comparison made by us from the product sheets of three bags sold in big-box stores.",
panelTitle: "How production is going"
}
}
</script>
<template>
<HeroBundleKit 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 |
| items* | Item[] | Datathe pieces of a kit |
| 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") |
Item items[] · 6 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe product’s name |
| price* | number | an amount in cents |
| currency | string | DesignISO 4217, EUR by default |
| image | string | null | Picturethe main picture; null or absent: the product has none yet |
| alt | string | Wordswhat the main picture shows |
Options options · 5 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short chip above the title |
| note | string | Wordsthe footnote, under the kit |
| 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 |
| asset | a picture’s address as your app serves it |
| 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, 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
- Bento promise top: the promise as a wide band across the top, the collections’ pictures in a row under it: 2 or 3 collections, or a long promise.
- Brand statement poster: a condensed, oversized headline in capitals on a flat brand field, a ruled strip of facts and one picture on the half: a launch, an event, a bold brand.
- Brand statement type behind: a huge centred headline with one framed upright picture standing over its middle, the facts in a ruled strip: an editorial or portfolio opening.
- Brand statement type mask: a one- or two-word statement (a name, a place) at the viewport’s scale with the first picture showing only through its letters, faint behind too: a brand with one striking texture picture (rock, fabric, wood).
- Capabilities chips: many small capabilities: a row of chips under the actions says what the product covers at a glance.
- Centered framed: the same centred promise set inside a bordered panel with corner marks, the eyebrow as a tab on its edge and the fine print along its foot: a launch or an announcement that should read like a printed notice.
- Centered minimal: a type-first opening for a product or a launch: a very large promise whose last words take the theme gradient, on a fine grid, standing on a glowing horizon arc at the foot.
- Colorways split list: the words and the colours as a list of named rows at the left, each with its swatch and price, the piece tall at the right and wiping to the chosen colour: colours whose names, notes and prices differ and deserve to be read.