Prompt split — Hero block
Prohero-prompt-split · for home, landing pages
Prompt split
The same prompt as a working card beside the promise: a product whose promise needs a longer sentence, or a page whose heroes start on one side
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-prompt-splitUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HeroPromptSplit from '@/components/trame/blocks/hero/hero-prompt-split.vue'
const props = {
eyebrow: "New: trips with several cities",
title: "Tell us where you want to go. We plan every day of it.",
subtitle: "Tripvane turns one sentence into a day-by-day plan: where to sleep, what to book ahead, and how to get between it all.",
prompt: {
action: "trip.plan",
label: "Describe your trip",
placeholder: "A long weekend in Lisbon with two kids who love trams…",
button: "Plan my trip",
maxLength: 600
},
suggestions: [
"3 days in Lisbon, food and tiles",
"A week of Japanese onsen towns"
],
note: "Free for your first three trips. No card needed.",
secondaryAction: {
label: "See sample trips",
action: "trips.samples"
}
}
</script>
<template>
<HeroPromptSplit 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 title ("New: multi-city trips") |
| title* | string | Wordsthe one promise, in a sentence ("Tell us where. We plan the rest.") |
| subtitle | string | Wordswhat the product does with the prompt, in one or two sentences |
| prompt* | Prompt | the prompt field: what it asks, its button and the page it opens |
| suggestions | string[] | Wordsone example prompt ("3 days in Lisbon, food and tiles") |
| note | string | Wordsfine print under the field ("Free to try, no card needed") |
| secondaryAction | SecondaryAction | a quieter second action beside the main one: its words and the page action |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Prompt prompt · 5 props
| Prop | Type | Description |
|---|---|---|
| action* | string | Actionthe page the prompt opens: the form sends the text as `q` to href(action) (a GET, "/plan?q=…") |
| label* | string | Wordswhat the field asks ("Describe your trip"): visible in a card, read by screen readers everywhere |
| placeholder | string | Wordsan example of a good prompt, shown in the empty field ("A long weekend in Lisbon with two kids") |
| button* | string | Wordsthe submit ("Plan my trip") |
| maxLength | number | the longest prompt the product takes, in characters |
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 · 2 props
| Prop | Type | Description |
|---|---|---|
| background | 'glow' | 'grid' | 'plain' | the section’s background: glow, grid, plain |
| 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 |
| 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:
link,secondaryAction
A hero section, for home, landing pages; it uses @lucide/vue, @vueuse/core, 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
- Product slides fullbleed card: pictures edge to edge, the words on the calm side and the campaign’s product on a card at the other, arrows at the edges: a shop whose scenes sell and whose first click should land on a product.
- Profile facts: a studio or freelancer opening: who, what and a few key facts, with the recognitions they earned in a card beside — the merchant’s own only.
- Project inquiry split form: someone who wants to be written to: the key facts on one side, a short contact form on the other — the merchant’s own only.
- Projects numbered: a portfolio led by its work: a short intro and a numbered list of projects with their discipline and year — the merchant’s own only.
- Proof panel panels: an agency, a studio or a B2B tool whose proof is its track record: the promise on the left over an atmospheric picture, and on the right two frosted panels, the figures (a lead figure, a share as a bar, a ruled row) above the clients’ logos passing at the expressive level — the merchant’s own figures and clients only.
- Proof panel stacked: the same proof in a quieter, wider opening: the promise centred on top, the figures and the clients’ logos in two frosted panels side by side under it — the merchant’s own figures and clients only.
- Reel mosaic: the promise centred on a quiet pattern that lights up around the pointer (the grid with a few brief light streaks), then a calm bento of short muted clips within the page width: a studio, a tool or a library whose own work is the argument (the host’s own work only).
- Reel side: the mosaic turned on its side: a wide feature clip with up to three smaller ones under it on the start side, the promise beside them aligned to the start, over the same quiet pattern: a studio, a tool or a library that leads with one piece of its work and wants the words read alongside it (the host’s own work only).