Ask docked — FAQ block
Profaq-ask-docked · for home, product, landing, catalog pages
Ask docked
The questions as an accordion in a card, and docked under it a field where the visitor asks their own question and sends it to the merchant: a shop or landing page whose team answers questions by e-mail
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/faq-ask-dockedUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import FaqAskDocked from '@/components/trame/blocks/faq/faq-ask-docked.vue'
const props = {
eyebrow: "Common questions",
title: "Before you order",
lead: "Not on the list? Just ask.",
items: [
{
question: "How long does delivery take?",
answer: "Orders placed before 2 p.m. ship the same day. Allow two to four business days within the contiguous US.\n\nYou’ll get an email with tracking as soon as it ships."
},
{
question: "Can I return an item?",
answer: "Yes, you have 30 days after delivery to send back an unused item in its original packaging. Returns are free through a pickup point."
}
],
ask: {
action: "faq.ask",
title: "Didn’t find your answer?",
placeholder: "Ask about sizes, delivery, a gift…",
hint: "We reply by email within a working day, from the workshop."
}
}
</script>
<template>
<FaqAskDocked v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordswhat this is ("Common questions") |
| title* | string | Wordsthe section’s title ("Before you order") |
| lead | string | Wordsone sentence under the title ("Not on the list? Just ask.") |
| items* | Item[] | the items shown, in order |
| ask* | Ask | the form where the visitor asks a question |
| 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 question, as a customer would ask it |
| answer* | string | Wordsthe answer, in plain sentences; a blank line starts a new paragraph |
Ask ask · 5 props
| Prop | Type | Description |
|---|---|---|
| action* | string | Actionthe page action that receives the visitor’s question (and their e-mail): the merchant answers it; the field is hidden when the page lacks it |
| title | string | Wordswhat the field invites ("Didn’t find your answer?"); the host’s words when absent |
| placeholder | string | Wordsan example inside the field ("Ask about sizes, delivery, a gift…") |
| hint | string | Wordswhen and how the answer comes, as the merchant promises it ("We reply by e-mail within a working day") |
| boolean | ask for an e-mail address to answer to (true by default; false when the host already knows the visitor) |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| openFirst | boolean | the first answer starts open (true 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:
ask
A faq section, for home, product, landing, catalog 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 faq blocks
- Accordion: 3 to 10 questions on a narrow centred column, ruled rows, one open at a time: the usual FAQ.
- Aside intro: the title, lead and help card in a sticky column beside the accordion: a landing or shop page where the FAQ sits next to a reassuring intro.
- Assisted questions sidebar: a title, a help card and a picture on one side, the questions on the other: when a person can be reached.
- Card grid: one card per question with its topic as a kicker, the help card as a bar under the grid: six to eight short answers to skim.
- Grouped: a long FAQ sorted by theme, each theme its own short accordion with an index above it.
- Hub search first: a large search field and the merchant’s short list of key questions: visitors who know what they look for.
- Hub side nav: topics listed beside the answers, with a search field: a large help centre of 15 questions or more.
- Hub topic tiles: a grid of topic tiles with their question count, leading to the answers or to their own pages: 6 topics or more.