Video device side — Hero block
Freehero-video-device-side · for home, landing pages
Video device side
The words beside a phone holding a vertical film, over a tinted disc: a mobile app, a reel or a portrait film; the merchant’s own film only
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-video-device-sideUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HeroVideoDeviceSide from '@/components/trame/blocks/hero/hero-video-device-side.vue'
const props = {
title: "Learn to row on the river, from your first stroke to your first race",
subtitle: "Eight-week beginner courses, Saturday and Sunday mornings, boats and coaching included. Watch a dawn outing before you sign up.",
poster: "https://images.unsplash.com/photo-1569406125624-98ee19b01d4a?w=1600&q=80",
video: "/films/riverside.mp4",
primaryAction: {
label: "Join a beginner course",
action: "booking"
},
secondaryAction: {
label: "See the outings",
action: "page",
record: {
id: "programme"
}
},
speaker: {
name: "Sam Whitaker",
role: "head coach of the Riverside Rowing Club"
},
options: {
eyebrow: "A morning on the water",
note: "The film has English subtitles.",
alt: "A rowing eight in silhouette on golden water at dawn",
duration: "2 min",
mood: "inverse"
}
}
</script>
<template>
<HeroVideoDeviceSide v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe promise, in a sentence: the page’s h1 |
| subtitle | string | Wordswhat the visitor gets and for whom, in one or two sentences |
| poster | string | Picturethe picture shown before the film plays: a still of the film itself |
| video* | string | Picturethe merchant’s own film: a file (.mp4,.webm) or the address of the player to embed; nothing is fetched before the visitor presses play, except in the ambient variant, where a file plays muted in a loop by itself once near the screen (a short film of a few MB at most) |
| 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 |
| speaker | Speaker | the person on screen |
| proof | Proof | a social-proof line under the actions, an avatar stack beside one short line: the merchant’s own customers and figure only, never invented; hidden when absent |
| 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 ("Book a class") |
| 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 ("Book a class") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Speaker speaker · 2 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe person on screen, by name, as the merchant gives it |
| role | string | Wordswhat they do ("ceramicist and founder of the workshop") |
Proof proof · 2 props
| Prop | Type | Description |
|---|---|---|
| avatars* | Avatar[] | three to five of the merchant’s own customers’ pictures |
| text* | string | Wordsthe merchant’s own figure, word for word ("16K+ happy clients") |
Avatar proof.avatars[] · 3 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe avatar’s name |
| alt* | string | Wordswho the picture shows |
| src | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
Options options · 5 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short chip above the title ("The workshop film") |
| note | string | Wordsfine print under the actions |
| alt | string | Wordsthe poster’s description, when it shows something the title does not say |
| duration | string | Wordsthe film’s length as the merchant wrote it ("2 min"), never computed |
| 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
- Trio staggered: the promise above three featured products set at different heights: a small range the shop is proud of in full.
- Trusted logo strip: a B2B opening whose proof is who already uses it: the merchant’s own logos under a thin rule.
- Type centered: centred, the pictures under it in a row whose middle one stands taller: a launch, a calmer brand.
- Type inline pictures: left-aligned, 1 to 3 of the pictures set inside the sentence at cap height (a pill, or overlapping circles), no strip: a team, a studio or a maker whose faces or objects belong in the sentence.
- Type statement: left-aligned and huge, the text and the action on a rule under the statement, the pictures in a staggered strip: a brand with a voice.
- Views stepper side: the words on the left with a numbered stepper under the actions, the chosen screen on the right running off the page: screens that follow an order (set up, run, report).
- Views tabs over: the words centred, a row of pill tabs under the actions and the chosen screen in a wide frame below: a product whose screens weigh the same (planning, invoices, reports).
- Wall card over grid: a dense grid of square pictures edge to edge with the words on a solid card over its middle: a portfolio whose pictures are all of one hand (the merchant’s own work only).