Bento promise top — Hero block

Free

hero-bento-promise-top · for home pages

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

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-bento-promise-top

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import HeroBentoPromiseTop from '@/components/trame/blocks/hero/hero-bento-promise-top.vue'

const props = {
title: "Simple things, made to last",
text: "A small selection, refreshed every season, made close to home.",
action: {
label: "See what’s new",
action: "catalog"
},
cells: [
{
image: "https://images.unsplash.com/photo-1515886657613-9f3515b0c78f?w=1600&q=80",
alt: "A yellow tracksuit on a seaside court",
title: "Clothing",
text: "For every day",
action: "collection",
record: {
id: "vetements"
}
},
{
image: "https://images.unsplash.com/photo-1616696038562-574c18066055?w=1600&q=80",
alt: "Two cognac leather shoes on turquoise fabric",
title: "Shoes",
text: "Leather and canvas",
action: "collection",
record: {
id: "chaussures"
}
}
],
options: {
eyebrow: "Portland workshop"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe shop’s promise, 4 to 10 words: the page’s h1
cells*Cell[]2 to 4 collections to open at once; a fifth is never shown
textstringWordsone or two sentences under the promise
actionActionthe call to action: its words and the page action it runs
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Cell cells[] · 6 props
PropTypeDescription
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the picture shows, when the name does not say it (empty: decorative)
title*stringWordsthe collection’s name, 1 to 4 words
action*stringActionwhere the cell leads: the catalogue, or a category with its record
recordRecord<string, unknown>Datathe record the action opens (a category), if any
textstringWordsa few words under the name
Action action · 3 props
PropTypeDescription
label*stringWordswhat happens ("See what is new")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
Options options · 3 props
PropTypeDescription
eyebrowstringWordsa few words above the promise (the shop’s trade, its place)
tone'brand' | 'inverse' | 'plain'the promise’s cell: brand (by default), inverse (dark), plain (the page’s card)
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
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: cells[], action

A hero section, for home 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

  • App introduction browser: a screenshot of the product in a window: software or an app whose interface is the argument — the merchant’s own only.
  • Audience centered: a pill switch above a centred promise, the chosen side’s picture in a wide frame below: a two-sided product whose sides weigh the same and whose pictures read best wide (freelancers and companies, patients and practitioners).
  • Audience split: the switch and the words on the left, the chosen side’s picture tall on the right: a two-sided product with portrait pictures of people at work, or a page that needs its actions high on the first screen.
  • 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).
  • Bundle kit: a bundle of two to five pieces: what is in it, what it costs bought apart, and what the kit saves.
  • Capabilities chips: many small capabilities: a row of chips under the actions says what the product covers at a glance.

All 102 hero blocks