Product Q&A question index — Storefront block
Freestorefront-product-qa-question-index · for product pages
Product Q&A question index
Every question first as a numbered index of links, then each answer open under its number: a long list of questions a shopper scans before reading; the merchant's own questions only.
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/storefront-product-qa-question-indexUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontProductQaQuestionIndex from '@/components/trame/blocks/storefront/storefront-product-qa-question-index.vue'
const props = {
title: "The details that matter",
intro: "Our advice for this model.",
items: [
{
question: "How do I clean the canvas?",
answer: "Wipe marks with a damp cloth, then let it air-dry. Avoid rubbing the seams."
},
{
question: "Can I remove the shoulder strap?",
answer: "Yes, the clips undo by hand. Store the strap flat so it doesn’t crease."
}
]
}
</script>
<template>
<StorefrontProductQaQuestionIndex 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 |
| intro | string | Wordsa sentence or two under the heading |
| items* | Item[] | the items shown, in order |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 2 props
| Prop | Type | Description |
|---|---|---|
| question* | string | Wordsthe merchant’s own question about this product |
| answer* | string | Wordsthe merchant’s own answer |
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
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
A storefront section, for product pages; it uses @lucide/vue.
More storefront blocks
- Product overview poster panel: the first picture as a wide panel carrying the product’s one-line summary, its story and three of its highlights, a narrow buy box beside it and the other facts in a band under both: a single-product shop or a hero product whose page should read like a landing.
- Product overview split: the gallery with its thumbnails beside a buy box: the default for any product with a few pictures.
- Product overview stacked: every picture in full, one under the other, beside a buy box that stays in view (a carousel on a phone): fashion and objects with many photographs, where the pictures sell.
- Product patina compare: two pictures of the same product, new and worn, split by a handle, with a part-by-part table: durability told by its owner; the merchant’s own only.
- Product profile scale bars: Labelled scales with a precise marker for roast, body or intensity; the merchant’s own only.
- Product quick view bottom sheet: a sheet rising from the bottom edge, a small picture beside the name: phones, one thumb away.
- Product quick view drawer: a side sheet with the picture on top and the choices under it: a catalogue grid that should keep its place at the side.
- Product quick view split dialog: a centred dialog, the picture on the left and the choices on the right: desktop catalogues where the list stays in view behind.