Feedback form steps — Contact block
Freecontact-feedback-form-steps · for home, account, checkout, app pages
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
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-feedback-form-stepsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import ContactFeedbackFormSteps from '@/components/trame/blocks/contact/contact-feedback-form-steps.vue'
const props = {
title: "Your feedback, in one minute",
lead: "The workshop team reads your answers every week.",
questions: [
{
id: "note",
label: "Overall, how did your order go?",
kind: "rating",
required: true
},
{
id: "commentaire",
label: "A word for the team?",
hint: "What you liked, what we could do better.",
kind: "text"
}
],
submit: {
label: "Send my feedback",
action: "feedback"
},
thanks: {
title: "Thank you, we got it.",
text: "If you left a note, we’ll read it on Monday at our team meeting."
},
options: {
maxLength: 500
}
}
</script>
<template>
<ContactFeedbackFormSteps v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the form asks ("How did your order go?") |
| lead | string | Wordsone sentence on why and who reads the answers |
| questions* | Question[] | the questions, one to twelve, in the order they are asked |
| submit* | Submit | the submit action: its words and the page action it runs |
| thanks | Thanks | what the visitor sees once the answers are recorded |
| sent | boolean | the host’s word that the answers were recorded: the form gives way to the thanks |
| error | string | Wordsthe host’s message when the answers could not be recorded |
| busy | boolean | the answers are being sent |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Question questions[] · 6 props
| Prop | Type | Description |
|---|---|---|
| id* | string | Designthe answer’s key in what the form sends ("delivery") |
| label* | string | Wordsthe question, as the merchant asks it ("How did the delivery go?") |
| hint | string | Wordsone line under the question |
| kind* | 'rating' | 'scale' | 'choice' | 'text' | rating: five stars or faces; scale: a 1-to-5 track with its words; choice: one answer among `choices`; text: a free comment |
| choices | string[] | Wordsthe answers of a choice question; for a scale, its five words (the app’s own when absent) |
| required | boolean | true: it must be filled in |
Submit submit · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe button ("Send my review") |
| action* | string | Actionthe page action that records the answers |
Thanks thanks · 2 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe thanks once the answers are recorded ("Thank you for your feedback") |
| text | string | Wordswhat happens next |
Options options · 4 props
| Prop | Type | Description |
|---|---|---|
| scale | 'stars' | 'faces' | how a rating is drawn: five stars (default) or five faces with their names |
| anonymous | boolean | offer a switch to send the answers without one’s name |
| maxLength | number | the longest comment, in characters (500 by default) |
| 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 |
| 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:
feedback.submit
A contact section, for home, account, checkout, app pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More contact blocks
- Contributor call commission cards: Commission formats with explicit scope rows, using the merchant's own rates and delays only.
- Contributor call split steps: Topics beside an ordered pitch process, with the merchant's own terms only.
- Directory: a table of topic, who answers, address and reply time: a larger house with many inboxes, looked up rather than read.
- Form big contacts: a very large title and the main addresses in oversized type beside a form of underlined fields: a studio or a premium brand, where the contact lines are the invitation.
- Form split: the contact lines and what happens next beside a real form: the default contact page.
- 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.
- 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.