Sections cards — Help block
Prohelp-sections-cards · for help, support pages
Sections cards
A help centre with topics: a card per topic with its count and its top articles
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/help-sections-cardsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HelpSectionsCards from '@/components/trame/blocks/help/help-sections-cards.vue'
const props = {
title: "How can we help?",
lead: "Search for an answer, or browse the topics.",
search: "help-search",
searchLabel: "Describe your question",
categories: [
{
id: "commandes",
name: "Orders and payment",
count: 14,
summary: "Track, change or cancel an order.",
links: [
{
label: "Where is my order?",
action: "article",
record: {
id: "Where is my order?"
}
},
{
label: "Change my shipping address",
action: "article",
record: {
id: "Change my shipping address"
}
}
]
},
{
id: "livraison",
name: "Shipping",
count: 9,
links: [
{
label: "Delivery times",
action: "article",
record: {
id: "Delivery times"
}
},
{
label: "Ship to a pickup point",
action: "article",
record: {
id: "Ship to a pickup point"
}
}
]
}
],
options: {
eyebrow: "Help"
}
}
</script>
<template>
<HelpSectionsCards v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the help centre says ("How can we help?") |
| lead | string | Wordsone sentence on what can be found here |
| search | string | Actionthe page that lists search results; the form sends "q" to it by GET |
| searchLabel | string | Wordsthe field’s label and placeholder ("Search the help") |
| categories* | Category[] | Datathe help topics, with their article count when it is counted |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Category categories[] · 7 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe category’s name |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the category’s picture shows |
| count | number | how many products it holds |
| summary | string | Wordsone short line on the category |
| links | Link[] | its top articles |
Link categories[].links[] · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "See the collection" |
| action | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
| url | string | Designan address outside the app |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa small line above the heading |
| 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
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
search,categories[].links[] - Reads
categoriesfrom your app
A help section, for help, support pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
More help blocks
- Resource library chips grid: Type chips sit above balanced resource cards for a mixed library of the merchant’s own content.; the merchant’s own only.
- Resource library featured first: The merchant’s first resource leads in a broad cover-and-summary panel above the remaining cards.; the merchant’s own only.
- Resource library sidebar: Type and topic filters occupy a sidebar, or a mobile drawer, for a larger merchant library.; the merchant’s own only.
- Resource library webinar rows: Ruled session rows surface the merchant’s own dates, hosts and upcoming or on-demand states only.; the merchant’s own only.
- Search hero: the help page’s opening: a large search field, suggested searches and the most read articles.
- Support channels band: the last step when the articles did not help: chat, e-mail or phone with their usual reply time.
- Symptom checks table: problems people recognise by what they see: what to check first and where the fix is.
- Topics cards: a help-centre front: one card per group of articles, its most useful entries listed under its title.