Centered framed — Hero block

Pro

hero-centered-framed · for home, landing pages

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

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-centered-framed

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import HeroCenteredFramed from '@/components/trame/blocks/hero/hero-centered-framed.vue'

const props = {
title: "Ship AI features without running a single GPU",
subtitle: "Kitebase serves open models behind one API, in three regions, billed by the second. Your team writes the feature; we keep it fast at 3 a.m.",
primaryAction: {
label: "Get an API key",
action: "signup"
},
secondaryAction: {
label: "Read the docs",
action: "docs"
},
options: {
eyebrow: "New: batch inference at half price",
note: "$20 of free credit, no credit card needed",
mood: "inverse"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe one promise, in a sentence (60 to 90 characters at most)
subtitlestringWordswhat it is and for whom, in one or two sentences
primaryAction*PrimaryActionthe main button: its words and the page action it runs
secondaryActionSecondaryActiona quieter second action beside the main one: its words and the page action
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
PrimaryAction primaryAction · 3 props
PropTypeDescription
label*stringWordswhat happens ("Try for free")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
SecondaryAction secondaryAction · 3 props
PropTypeDescription
label*stringWordswhat happens ("Try for free")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
Options options · 4 props
PropTypeDescription
eyebrowstringWordsa short chip above the title ("New")
notestringWordsfine print under the actions ("No bank card")
background'aurora' | 'pattern' | 'none'the section’s background: aurora, pattern, none
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
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: primaryAction, secondaryAction

A hero section, for home, landing pages; it uses 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

  • 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.
  • 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.
  • 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.

All 102 hero blocks