Diagram hub — Hero block
Prohero-diagram-hub · for home, landing pages
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
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-diagram-hubUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HeroDiagramHub from '@/components/trame/blocks/hero/hero-diagram-hub.vue'
const props = {
title: "Your account, your invoices and your books, finally in one place",
subtitle: "Fernbank connects to the tools your company already uses: every payment lands in the books with its receipt, and month-end takes an afternoon.",
primaryAction: {
label: "See the connections",
action: "integrations"
},
secondaryAction: {
label: "Talk to a banker",
action: "contact"
},
nodes: [
{
label: "Accounting",
icon: "package"
},
{
label: "Payroll",
icon: "truck"
}
],
center: {
label: "Fernbank"
},
options: {
eyebrow: "New: payroll connection",
note: "No monthly fee for your first year"
}
}
</script>
<template>
<HeroDiagramHub v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe one promise, in a sentence (60 to 90 characters at most) |
| subtitle | string | Wordswhat it connects and for whom, in one or two sentences |
| primaryAction* | PrimaryAction | the main button: its words and the page action it runs |
| secondaryAction | SecondaryAction | a quieter second action beside the main one: its words and the page action |
| nodes* | Node[] | the tools around it that the merchant really connects to |
| center | Center | what sits at the centre: the product’s name and mark |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
PrimaryAction primaryAction · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("See the integrations") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
SecondaryAction secondaryAction · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("See the integrations") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Node nodes[] · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe name of a tool the merchant really connects to |
| icon | string | Designan icon name when there is no logo: zap, shield, truck, leaf, sparkles, heart, clock, globe, lock, star, package, wrench; the initial by default |
| image | string | Picturethe tool’s own logo, if the merchant has the right to show it |
Center center · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe product’s name |
| image | string | Picturethe product’s mark |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short chip above the title ("New") |
| note | string | Wordsfine print under the actions |
| 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
- 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 @lucide/vue, 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
- Centered minimal: a type-first opening for a product or a launch: a very large promise whose last words take the theme gradient, on a fine grid, standing on a glowing horizon arc at the foot.
- 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.
- 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 countdown: the days left to the start, from the organiser’s date, beside the register button: an event within a few weeks.