Advice questions — Storefront block

Pro

storefront-advice-questions · for product, catalog, home pages

Advice questions

3 or 4 yes/no questions, each opening its advice (details, no script): a short questionnaire in the page

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-advice-questions

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontAdviceQuestions from '@/components/trame/blocks/storefront/storefront-advice-questions.vue'

const props = {
title: "Not sure which appointment to book?",
intro: "Three questions we ask at the front desk of Willow Street Physio, and what we usually suggest.",
questions: [
{
q: "Has the pain lasted more than two weeks?",
yes: "Book a first assessment: an hour to find the cause, not just the sore spot.",
no: "Rest, ice and gentle movement first. Call us if it is still there next week."
},
{
q: "Did it start with a fall, a twist or a knock?",
yes: "Ask for a sports injury slot: we check the joint before any exercise.",
no: "A standard assessment fits: posture, load and habits are the usual suspects."
}
],
help: {
text: "Still unsure? Describe what hurts and a physiotherapist will call you back within one business day.",
link: {
label: "Ask the clinic",
action: "page",
record: {
id: "contact"
}
}
}
}
</script>

<template>
<StorefrontAdviceQuestions v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordsthe section’s title, an h2
introstringWordsone or two sentences under the title
questions*Question[]the questions shown, in order
helpHelpa line and a link for the undecided
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Question questions[] · 3 props
PropTypeDescription
q*stringWordsa yes/no question ("Mostly worn in town?")
yes*stringWordsthe advice if yes
no*stringWordsthe advice if no
Help help · 2 props
PropTypeDescription
text*stringWordsthe line for the undecided ("Still not sure?")
linkLinkthe link: its words and the page action it runs
Link help.link · 3 props
PropTypeDescription
label*stringWordswhat happens ("Write to us")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
Options options · 1 props
PropTypeDescription
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
Linkyour router’s link component
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: help.link

A storefront section, for product, catalog, home pages; it uses @lucide/vue, clsx, motion, tailwind-merge.

More storefront blocks

  • Addon picker main and addons: a big main card with checkboxes for the add-ons beside it and the summary under: add-ons that complete one product.
  • Address check side by side: Compare the entered address with a postal service suggestion at equal prominence.
  • Address check stacked: Stack the two addresses in a narrow checkout column, keeping both choices available.
  • Adjusted cart with adjustment: when something besides the lines moves the price (a trade-in credit, import duties): a card explains it in numbered steps above the summary.
  • Ageing stages row: how a choice ages, in four moments from the first week to the fifth year: a break-in or durability story.
  • Alone or bundle versus: two columns, the product alone and the whole bundle, the bundle larger: a set sold at a real saving.
  • Archive figures numbers: Supplied figures and a period chart above the archive entries; the merchant's own measures only.
  • Archive shelf cards status: Material cards with a specification and a status beside the picture; the merchant's own archive only.

All 409 storefront blocks