Showcase framed media — Hero block
Prohero-showcase-framed-media · for home, landing pages
Showcase framed media
A product or an app with a screenshot: the words on top, the picture in a frame running off the fold
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-showcase-framed-mediaUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HeroShowcaseFramedMedia from '@/components/trame/blocks/hero/hero-showcase-framed-media.vue'
const props = {
title: "Fill every class, from the first booking to the last mat",
subtitle: "Mat & Hour runs the timetable, the waitlists and the class passes of yoga and pilates studios, so the front desk can say hello instead of checking a spreadsheet.",
primaryAction: {
label: "Open your timetable",
action: "signup"
},
secondaryAction: {
label: "See a studio’s week",
action: "demo"
},
image: "https://images.unsplash.com/photo-1496181133206-80ce9b88a853?w=1600&q=80",
options: {
eyebrow: "New: automatic waitlists",
note: "Free for your first 100 bookings",
alt: "An open laptop, screen off, on a light wood cabinet",
url: "app.matandhour.example/timetable"
}
}
</script>
<template>
<HeroShowcaseFramedMedia 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 is 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 |
| image* | string | Picturethe product’s screenshot |
| 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 ("Try for free") |
| 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 ("Try for free") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Options options · 7 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short chip above the title ("New") |
| note | string | Wordsfine print under the actions ("No bank card") |
| alt | string | Wordsthe screenshot’s description, when it shows something the words do not say |
| url | string | Wordsthe address shown in the browser frame |
| frame | 'browser' | 'device' | 'plain' | what frames the picture: a browser, a device or nothing |
| background | 'aurora' | 'pattern' | 'none' | the section’s background: aurora, pattern, none |
| 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
- Request bar: one to three short fields in a single bar under a centred promise: an address to leave, a quick callback.
- Service side card: someone who sells a service: what is offered, with the one-line scope and the price of each, in a card beside the intro — the merchant’s own only.
- Shopfront facade: the shop’s front edge to edge, the invitation over its foot and the address and hours on a card set like a plaque beside the door: a shop whose street front is its best picture (a bakery, a florist, a bookshop).
- Shopfront shop window: the words, the address and the hours as a ruled timetable on the page’s ground, the front in a tall arched window with the inside pictures set against it: a calmer opening, or a front photographed close.
- Signature corner tiles: one full-bleed picture with the promise at its lower left and the pieces as small picture tiles in the lower-right corner: fashion or accessories, where the picture is the argument and the products a discreet addition.
- Signature product rail: a large picture with the promise at its foot and the two or three pieces stacked in a dark column beside it: a shop that wants the promise and the way to buy in the same first screen.
- Signature scene card: a framed scene with the promise at its left and one piece’s card standing on the right, arrows to switch between pieces: a lifestyle shop whose products are shown in a room, not cut out.
- Signature split card: a magazine-like split: a tall picture with one product’s card resting on it: a shop with one hero product or a signature piece.