Audience centered — Hero block
Prohero-audience-centered · for home, landing pages
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).
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-audience-centeredUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HeroAudienceCentered from '@/components/trame/blocks/hero/hero-audience-centered.vue'
const props = {
eyebrow: "One invoice, two sides of the same table",
audiences: [
{
label: "For freelancers",
title: "Send the invoice, get paid on time, skip the follow-up",
subtitle: "Fernbill turns a signed quote into an invoice, chases late payers politely for you and pays out within two business days.",
picture: {
src: "https://images.unsplash.com/photo-1774628876934-aefd2199f733?w=1600&q=75",
alt: "An illustrator’s desk under a window, drawings and prints pinned on the wall"
},
primaryAction: {
label: "Start invoicing free",
action: "signup",
record: {
side: "freelancer"
}
},
secondaryAction: {
label: "See how payouts work",
action: "payouts"
}
},
{
label: "For companies",
title: "Pay every freelancer from one place, in one batch",
subtitle: "Approve invoices as a team, pay them all on Friday and keep every contract, tax form and receipt in the same file.",
picture: {
src: "https://images.unsplash.com/photo-1791472656672-79d47c383e94?w=1600&q=75",
alt: "Three colleagues meet around a table in a sunlit office"
},
primaryAction: {
label: "Book a walkthrough",
action: "demo"
},
secondaryAction: {
label: "Compare plans",
action: "pricing"
}
}
],
proof: "Free for freelancers. Companies pay 1% per payout, capped at $20."
}
</script>
<template>
<HeroAudienceCentered v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short line above the switch, shared by every side ("One account, two sides of the same invoice") |
| audiences* | Audience[] | 2 or 3 sides of the product, in the order of the switch; the first is shown first |
| proof | string | Wordsone shared line under the actions, the host’s own fact ("Used by 4,000 studios since 2019"): the host’s own only |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Audience audiences[] · 6 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe switch’s word for this side, short ("For freelancers", 1 to 3 words): also the address (#for-freelancers) that opens it |
| title* | string | Wordsthis side’s promise, in a sentence (40 to 80 characters): the page’s h1 while it is shown |
| subtitle | string | Wordswhat this side gets, in one or two sentences |
| picture | Picture | a picture of this side at work (landscape reads best); a soft panel with the label when absent |
| primaryAction* | PrimaryAction | the main button for this audience: its words and the page action |
| secondaryAction | SecondaryAction | a quieter second action for this audience |
Picture audiences[].picture · 2 props
| Prop | Type | Description |
|---|---|---|
| src* | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt* | string | Wordswhat the picture shows |
PrimaryAction audiences[].primaryAction · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Try for free") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
SecondaryAction audiences[].secondaryAction · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Try for free") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a 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).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| asset | a picture’s address as your app serves it |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your 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:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too 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
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
audiences[].primaryAction,audiences[].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
- 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.
- Bento cascade: the promise in a tall cell, the collections as tall portrait cards overlapping in a rising staircase beside it: 2 to 4 collections with tall, graphic pictures, for a shop that wants depth more than a grid.
- Bento promise left: the promise in a tall cell on the left, the collections’ pictures in a grid beside it: 3 or 4 collections to open at once.
- 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.
- 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.