Form stacked centered — Contact block
Procontact-form-stacked-centered · for contact pages
Form stacked centered
A centred title, a row of up to three columns (ways to reach, hours, what happens next) above the whole form in a soft card: a short page with a standard form
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/contact-form-stacked-centeredUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import ContactFormStackedCentered from '@/components/trame/blocks/contact/contact-form-stacked-centered.vue'
const props = {
title: "Write to us",
lead: "Every message is read by a person on the team, not a bot.",
routes: [
{
topic: "A question about an order",
address: "[email protected]",
who: "Noah and Sally",
delay: "Reply within 24 hours, Monday to Friday"
},
{
topic: "A repair",
address: "[email protected]",
who: "Ivy",
delay: "Reply within 3 business days"
}
],
hours: [
{
label: "Tuesday – Friday",
value: "10 a.m. – 6 p.m."
},
{
label: "Saturday",
value: "10 a.m. – 5 p.m."
}
],
steps: [
"We read your message the same day.",
"A person on the team replies by email."
],
form: {
action: "contact",
submit: "Send message",
nameLabel: "Your name",
emailLabel: "Your email address",
messageLabel: "Your message",
topicLabel: "Topic",
topics: [
"Une commande",
"Un produit"
],
orderLabel: "Order number",
consent: "Your message is read only by the team and never passed on to anyone else."
},
cta: {
label: "Book an appointment",
action: "booking"
}
}
</script>
<template>
<ContactFormStackedCentered v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the page offers ("Write to us") |
| lead | string | Wordsone sentence on who answers and how |
| routes | Route[] | who to contact for what, each a topic and a way to reach the team |
| hours | Hour[] | opening or answering hours: hidden when absent |
| steps | string[] | Wordsone step of what happens next |
| form* | Form | the contact form: where it posts and its fields’ words |
| cta | Cta | the call to action: its words and the page action it runs |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Route routes[] · 5 props
| Prop | Type | Description |
|---|---|---|
| topic* | string | Wordswhat it is for ("A question about an order") |
| address* | string | Wordsthe e-mail address, phone number or other way to reach them, exactly as it is |
| who | string | Wordswho answers |
| delay | string | Wordsthe usual reply time, measured by the merchant ("reply within 24 h") |
| badge | string | Wordsa status the merchant can stand behind ("Monday to Friday") |
Hour hours[] · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe days or the place ("Monday – Friday") |
| value* | string | Wordsthe hours ("9 am – 6 pm") |
Form form · 11 props
| Prop | Type | Description |
|---|---|---|
| action* | string | Actionthe page action the form posts to |
| submit* | string | Wordsthe button ("Send the message") |
| nameLabel* | string | Wordsthe name field’s label ("Your name") |
| emailLabel* | string | Wordsthe e-mail field’s label ("Your email address") |
| messageLabel* | string | Wordsthe message field’s label ("Your message") |
| topicLabel | string | Wordsthe topic field’s label ("Topic") |
| topics | string[] | Wordsone topic of the selector |
| orderLabel | string | Wordsthe order-number field’s label ("Order number"), without "(optional)": the block adds it |
| consent | string | Wordsthe line under the button on how the message is used |
| privacyAction | string | Actionthe page that states how the personal data is used, linked after the consent line |
| privacyLabel | string | Wordsthe privacy link’s words ("Privacy policy") |
Cta cta · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Book an appointment") |
| 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 |
|---|---|---|
| showTopic | boolean | false: hides the topic choice on the form |
| 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:
form,form.privacyAction,cta
A contact section, for contact pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
More contact blocks
- Feedback form panel: one card with the rating, the comment and the button: one or two questions after a visit, an order or a delivery.
- Feedback form scale strip: the words beside wide 1-to-5 tracks that name the chosen level: a quick satisfaction pulse of one to three questions.
- Feedback form steps: one question at a time under a progress bar, back and next at the foot: a survey of three to twelve questions.
- Idea request form: a visitor can propose an idea: how ideas are handled beside a short form.
- Inquiry picker stepper panel: three numbered steps at the left (the request, the details, the message) and one panel at the right with back and continue: a longer request, a quote or a project brief; reply times are the merchant’s own measured ones.
- Inquiry picker tiles then form: a row of choice tiles, the chosen one lit, the form under them with that topic’s reply time and direct way: a contact or demo page with two to six kinds of request; reply times are the merchant’s own measured ones.
- Intake form: a request with picks and notes (custom order, repair, trade): the fields and one send button.
- Invite email only: one large address and a secondary action: a tiny business with a single inbox.