Feedback form steps — Contact block

Free

contact-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-steps

Usage

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.

PropTypeDescription
title*stringWordswhat the form asks ("How did your order go?")
leadstringWordsone sentence on why and who reads the answers
questions*Question[]the questions, one to twelve, in the order they are asked
submit*Submitthe submit action: its words and the page action it runs
thanksThankswhat the visitor sees once the answers are recorded
sentbooleanthe host’s word that the answers were recorded: the form gives way to the thanks
errorstringWordsthe host’s message when the answers could not be recorded
busybooleanthe answers are being sent
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Question questions[] · 6 props
PropTypeDescription
id*stringDesignthe answer’s key in what the form sends ("delivery")
label*stringWordsthe question, as the merchant asks it ("How did the delivery go?")
hintstringWordsone 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
choicesstring[]Wordsthe answers of a choice question; for a scale, its five words (the app’s own when absent)
requiredbooleantrue: it must be filled in
Submit submit · 2 props
PropTypeDescription
label*stringWordsthe button ("Send my review")
action*stringActionthe page action that records the answers
Thanks thanks · 2 props
PropTypeDescription
title*stringWordsthe thanks once the answers are recorded ("Thank you for your feedback")
textstringWordswhat happens next
Options options · 4 props
PropTypeDescription
scale'stars' | 'faces'how a rating is drawn: five stars (default) or five faces with their names
anonymousbooleanoffer a switch to send the answers without one’s name
maxLengthnumberthe longest comment, in characters (500 by default)
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa 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).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour 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:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo 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.

All 25 contact blocks