Event countdown — Hero block

Pro

hero-event-countdown · for landing, event, home pages

Event countdown

The days left to the start, from the organiser’s date, beside the register button: an event within a few weeks

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-event-countdown

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import HeroEventCountdown from '@/components/trame/blocks/hero/hero-event-countdown.vue'

const props = {
title: "Low Tide Festival",
kicker: "Three days of music on the beach, 40 artists, two stages",
startsAt: "2027-08-13",
endsAt: "2027-08-15",
place: "North Beach, Port Haven",
image: "https://images.unsplash.com/photo-1790511637969-5864152f9e38?w=1600&q=80",
primaryAction: {
label: "Get a 3-day pass",
action: "register",
record: {
id: "pass-3-days"
}
},
secondaryAction: {
label: "See the lineup",
action: "programme"
},
options: {
time: "2 p.m. – midnight",
alt: "The beach stage at dusk, pink lights over the crowd and the sea behind",
asOf: "2026-10-12",
mood: "inverse"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe event’s name, as the organiser calls it
kickerstringWordswhat kind of event it is, in a few words ("Craft trades meetings")
startsAt*stringDatathe first day, as the organiser set it (ISO date): the only source of every date shown
endsAtstringDatathe last day when the event lasts more than one, as the organiser set it
placestringWordswhere it happens, as the organiser wrote it ("Halle Tony Garnier, Lyon")
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
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 ("Book my place")
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 ("Book my place")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
Options options · 4 props
PropTypeDescription
timestringWordsthe hours as the organiser wrote them ("9 am – 6 pm")
altstringWordsthe picture’s description, when it shows something the title does not say
asOfstringDesignthe day the page is rendered (ISO date) for the distance to the start; when absent the browser counts it once loaded, and the server writes 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
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: primaryAction, secondaryAction

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

More hero blocks

  • 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.
  • Duo framed captions: two rounded frames on a dark band, a product card on each picture and the title with its link under the frame: a quieter, gallery-like opening.
  • 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.
  • Duo offset: two columns at different heights on the page’s own ground, each title large above its picture and the product riding the picture’s edge: an editorial, magazine-like opening for two entries of equal weight.
  • 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.
  • Figures stat band: a number is the argument: a bordered band of three to five figures the merchant states.
  • Finder: a product choice that needs a few questions: the first question shown, the real finder one click away.

All 102 hero blocks