Figures stat band — Hero block

Pro

hero-figures-stat-band · for home, landing pages

Figures stat band

A number is the argument: a bordered band of three to five figures the merchant states

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-figures-stat-band

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import HeroFiguresStatBand from '@/components/trame/blocks/hero/hero-figures-stat-band.vue'

const props = {
title: "Learn interface design in the evening, from people who do it all day",
subtitle: "Northfield School of Design runs twelve-week courses, two evenings a week, in the studio or online. Every brief is real, every crit is in person.",
primaryAction: {
label: "See the April courses",
action: "courses"
},
secondaryAction: {
label: "Visit an open evening",
action: "open-evening"
},
stats: [
{
value: "16",
label: "students per cohort, never more"
},
{
value: "12 weeks",
label: "two evenings a week"
}
],
options: {
eyebrow: "Enrollment opens March 1",
note: "Pay in three installments, no interest"
}
}
</script>

<template>
<HeroFiguresStatBand 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
stats*Stat[]the stats shown, in order
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
Stat stats[] · 2 props
PropTypeDescription
value*stringWordsthe figure as the merchant states it ("12,400")
label*stringWordswhat it counts
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

  • 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.
  • Finder: a product choice that needs a few questions: the first question shown, the real finder one click away.
  • Float deck: the title set on the left and the pictures fanned on the right like a hand of cards, the first product in front: 2 to 4 products with one to lead, a more personal, collected opening.
  • Float orbit: the title above, the pictures in a gentle arc under it, the middle one largest: 2 to 4 products, a calmer opening.
  • Float scatter: the pictures around the title at different sizes and depths, as if set down on a table: 3 or 4 products that read well alone.

All 102 hero blocks