Duo full panels — Hero block

Pro

hero-duo-full-panels · for home pages

Duo full panels

Two tall pictures edge to edge, each title large over its foot and a product chip in its corner: a shop with two strong scenes that opens on two doors

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-duo-full-panels

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import HeroDuoFullPanels from '@/components/trame/blocks/hero/hero-duo-full-panels.vue'

const props = {
panels: [
{
image: "https://images.unsplash.com/photo-1714836986273-9a62b37f55fa?w=1600&q=80",
alt: "A wooden table set with two gray plates and dish towels",
title: "The everyday table",
action: {
label: "See tableware",
action: "collection",
record: {
id: "table"
}
},
product: {
id: "bols-gres",
name: "Speckled stoneware bowls, set of two",
price: 3800,
image: "https://images.unsplash.com/photo-1530006498959-b7884e829a04?w=480&q=80",
alt: "Two speckled white stoneware bowls stacked on a dark background"
}
},
{
image: "https://images.unsplash.com/photo-1578500494198-246f612d3b3d?w=1600&q=80",
alt: "A light brown sofa with a gray throw and pampas grass in a vase",
title: "A softer living room",
action: {
label: "See home linens",
action: "collection",
record: {
id: "salon"
}
},
product: {
id: "plaid-laine",
name: "Wool throw",
price: 8900,
compareAt: 9900,
image: "https://images.unsplash.com/photo-1756361771520-8711a9ff4668?w=480&q=80",
alt: "Rolled wool throws"
}
}
],
options: {
eyebrow: "Home · new season"
}
}
</script>

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

Props

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

PropTypeDescription
panels*Panel[]exactly two equally strong entries (two categories, two campaigns); with one, use HeroSignature
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Panel panels[] · 5 props
PropTypeDescription
imagestringPicturethe entry’s scene, a tall picture; without one the panel is a brand tint
altstringWordswhat the picture shows (empty: decorative)
title*stringWordsthe entry’s promise, 2 to 6 words ("The summer table"); the first one is the page’s h1
actionActionthe panel’s call to action: its words and the page action
product*ProductDataone product of this entry to start from, from the catalogue tool
Action panels[].action · 3 props
PropTypeDescription
label*stringWordswhat happens ("See the table")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens (a category, a collection)
Product panels[].product · 7 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
name*stringWordsthe product’s name
price*numberan amount in cents
compareAtnumberthe price before the merchant’s reduction
currencystringDesignISO 4217, EUR by default
imagestring | nullPicturethe main picture; null or absent: the product has none yet
altstringWordswhat the main picture shows
Options options · 2 props
PropTypeDescription
eyebrowstringWordsa short line over both entries ("New season")
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
moneyformats a price, given in cents
asseta picture’s address as your app serves it
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: panels[].action
  • Reads products from your app

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

More hero blocks

  • Colorways swatch stage: the title centred over a wide stage holding the chosen colour, the swatches in a pill at its foot and the chosen piece’s card in its corner: a shop that opens on one piece whose colours are the news (a new dye, a season’s palette).
  • Comparison versus: an honest comparison with the usual alternative, row by row, the source stated by the merchant.
  • Diagram fan: a platform with many connections: centred words and a still fan of thin lines from the product to the tools below.
  • Diagram hub: a product that plugs into the tools a buyer already has: the words beside a hub with its real integrations, joined by a moving beam.
  • Event countdown: the days left to the start, from the organiser’s date, beside the register button: an event within a few weeks.
  • 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.

All 102 hero blocks