Responses table — Form block
Proform-responses-table · for app pages
Responses table
Read the received answers in a table using the current field labels.
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/form-responses-tableUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import FormResponsesTable from '@/components/trame/blocks/form/form-responses-table.vue'
const props = {
title: "Repair request",
description: "What we need to know to assess your item before the repair.",
fields: [
{
id: "article",
label: "Which item would you like repaired?",
type: "text",
required: true
},
{
id: "email",
label: "Your email address",
type: "email",
required: true
}
],
responses: [
{
article: "Rain jacket",
email: "[email protected]",
service: "Zipper",
detail: "The slider no longer closes the teeth."
},
{
article: "Hiking backpack",
email: "[email protected]",
service: "Stitching",
detail: "The strap is coming unstitched at the base."
}
]
}
</script>
<template>
<FormResponsesTable v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe section’s heading |
| description | string | Wordsa few words saying more, under the heading |
| fields* | Field[] | the form’s fields, in order |
| responses* | Record<string, unknown>[] | Datathe responses, one row each |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Field fields[] · 5 props
| Prop | Type | Description |
|---|---|---|
| id* | string | Designthe field’s key |
| label* | string | Wordsthe field’s name, as shown |
| type* | 'text' | 'email' | 'number' | 'textarea' | 'select' | what kind of field it is: text, email, number, textarea, select |
| required* | boolean | true: it must be filled in |
| choices | string[] | Wordsthe field’s choices, in order |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| 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
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Reads
rowsfrom your app
A form section, for app pages.
More form blocks
- Option group editor sheet: the groups listed on the page and the one chosen open in a side sheet, its fields above the buyer’s preview and the save bar: a back office where a dish or a product is edited in a panel over its list.
- Product editor full: Edit product content and ordered pictures beside publishing and pricing controls.
- Product editor side panel: Edit a product in a narrow workspace with a compact product preview above stacked controls.
- Product editor variants grid: Prioritize the size and colour stock matrix for a product with multiple SKUs.
- Record label left: a record with many plain fields, as in settings: each label and its help on the left, its field on the right.
- Record page: create or edit one record on its own page: titled sections as cards, short fields paired, a sticky save bar.
- Record panel: the same form in a drawer or a narrow column: one field per row, no cards, a sticky save bar.
- Record sections collapsible: a long record with optional parts (SEO, shipping, advanced): sections that fold, all open without script.