Topic answers pills — FAQ block
Profaq-topic-answers-pills · for landing, support, home pages
Topic answers pills
One long page grouped by topic, pills only filtering it: nothing to navigate, everything readable.
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-topic-answers-pillsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import FaqTopicAnswersPills from '@/components/trame/blocks/faq/faq-topic-answers-pills.vue'
const props = {
eyebrow: "Help center",
title: "How can we help?",
lead: "Answers to the questions we’re asked most often, sorted by topic.",
topics: [
{
key: "livraison",
label: "Shipping",
summary: "Delivery times, tracking and carriers",
items: [
{
question: "How long does delivery take?",
answer: "Allow 2 to 4 business days within the contiguous United States, 5 to 8 abroad.\n\nThe clock starts when we ship, not when you order.",
featured: true
},
{
question: "How do I track my package?",
answer: "We email you a tracking link as soon as the package leaves the workshop."
}
]
},
{
key: "retours",
label: "Returns and exchanges",
summary: "Time limits, fees and refunds",
items: [
{
question: "Can I return an item?",
answer: "Yes, within 60 days, in its original condition. The return label is free.",
featured: true
},
{
question: "When will I get my refund?",
answer: "Within 5 business days of receiving the package, to the payment method you used."
}
]
}
],
help: {
title: "Still have a question?",
text: "We reply Monday to Friday, 9 a.m. to 5 p.m.",
action: {
label: "Write to the team",
action: "contact"
}
}
}
</script>
<template>
<FaqTopicAnswersPills 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 ("Help centre") |
| title* | string | Wordsthe section’s title ("How can we help?") |
| lead | string | Wordsone sentence under the title |
| topics* | Topic[] | the topics, each with its questions |
| help | Help | a help card for questions left unanswered, with a way to reach the team |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Topic topics[] · 6 props
| Prop | Type | Description |
|---|---|---|
| key* | string | Designthe topic’s key, unique in the list ("delivery") |
| label* | string | Wordsthe topic’s name ("Delivery and returns") |
| summary | string | Wordsone line saying what the topic covers |
| action | string | Actionthe page of the topic, when it has its own (topic-tiles then link to it) |
| record | Record<string, unknown> | Datathe record the action opens, if any |
| items* | Item[] | the topic’s items, in order |
Item topics[].items[] · 3 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 |
| featured | boolean | the merchant chose it for the short list (search-first) |
Help help · 3 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the card offers ("A question left unanswered?") |
| text | string | Wordshow to reach the merchant, in a sentence |
| action | Action | the help box’s call to action: its words and the page action |
Action help.action · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Write to the team") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| openFirst | boolean | false: every answer starts closed; by default the first one is open |
| 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 |
| Link | your router’s link component |
| 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:
topics[],help.action
A faq section, for landing, support, home pages; it uses @lucide/vue, 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
- Illustrated answers verdicts: a policy FAQ where each answer is a word or a figure ("Yes", "60 days") set before the question.
- Open numbered: every answer visible as a numbered list in two columns: five to eight short answers to read without clicking.
- Published answers cards: short self-contained answers set as cards in a grid that adapts to the count: a help centre’s front.
- Published answers open: 4 to 8 short answers, nothing folded: every word visible and indexable at once.
- Question table: ruled rows of question, one-line answer (the verdict) and topic tag, each opening on the full answer: many short answers scanned like a table.
- Questions answers accordion: Native disclosures, initially open, for longer answers; the merchant’s own only.
- Questions answers list: Open customer questions with the verified origin of each answer; the merchant’s own only.
- Two columns: 8 to 14 short questions split in two columns, to avoid a long scroll.