Search hero — Help block

Pro

help-search-hero · for help, support pages

Search hero

The help page’s opening: a large search field, suggested searches and the most read 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-search-hero

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import HelpSearchHero from '@/components/trame/blocks/help/help-search-hero.vue'

const props = {
title: "How can we help?",
lead: "Search for an answer, or browse the topics.",
search: "help-search",
searchLabel: "Describe your question",
suggestions: [
"Package tracking",
"Return"
],
popular: [
{
id: "p1",
title: "Where is my order?",
section: "Orders"
},
{
id: "p2",
title: "Make a return in two steps",
section: "Returns"
}
],
open: "article",
options: {
eyebrow: "Help"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordswhat the help centre says ("How can we help?")
leadstringWordsone sentence on what can be found here
searchstringActionthe page that lists search results; the form sends "q" to it by GET
searchLabelstringWordsthe field’s label and placeholder ("Search the help")
suggestionsstring[]Wordsa search the merchant suggests
popularPopular[]Datathe articles the merchant ranks as most read, if it keeps such a count
openstringActionthe action that opens one article; the article is its record
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Popular popular[] · 9 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
title*stringWordsthe article’s title
excerptstringWordsa sentence or two from the article
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the cover picture shows
sectionstringWordsthe section it belongs to, e.g. "Guides"
authorAuthorwho wrote it
datestringWordswhen it was published, as the site writes it
readingTimestringWordshow long it takes to read, e.g. "6 min"
Author popular[].author · 6 props
PropTypeDescription
idstring | numberDatathe record’s id in the tool that answers it
name*stringWordsthe person’s name
rolestringWordstheir role or job title
companystringWordswhere they work
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
urlstringDesigna page about them
Options options · 3 props
PropTypeDescription
eyebrowstringWordsa small line above the heading
popularTitlestringWordsthe heading above `popular` ("Most viewed")
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
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: search, open
  • Reads articles from 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.
  • Sections cards: a help centre with topics: a card per topic with its count and its top 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.

All 22 help blocks