Resource library sidebar — Help block
Prohelp-resource-library-sidebar · for landing, article pages
Resource library sidebar
Type and topic filters occupy a sidebar, or a mobile drawer, for a larger merchant library.; the merchant’s own only
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-resource-library-sidebarUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HelpResourceLibrarySidebar from '@/components/trame/blocks/help/help-resource-library-sidebar.vue'
const props = {
title: "Something to take you further.",
subtitle: "Ideas to read, listen to and put into practice.",
items: [
{
id: "resource-1",
title: "The guide to giving an idea shape",
type: "Guide",
topic: "Method",
excerpt: "Concrete ideas to move forward at your own pace, organize your thoughts and find your own way of working.",
action: "resource",
image: "https://images.unsplash.com/photo-1598620617148-c9e8ddee6711?w=1600&q=80",
alt: "A blank spiral notebook and the tip of a pencil"
},
{
id: "resource-2",
title: "Building a method that suits you",
type: "Video",
topic: "Collaboration",
excerpt: "Concrete ideas to move forward at your own pace, organize your thoughts and find your own way of working.",
action: "resource",
image: "https://images.unsplash.com/photo-1787676415143-9916ec8c6122?w=1600&q=80",
alt: "Two pens on a sheet of paper, a hand at the edge of a wooden table"
}
],
filters: [
"type",
"topic"
],
options: {
eyebrow: "The library"
}
}
</script>
<template>
<HelpResourceLibrarySidebar v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe section’s heading |
| subtitle | string | Wordsa line under the heading |
| items* | Item[] | Datathe items shown, in order |
| filters | ('type' | 'topic')[] | which filters are offered: by type, by topic; both by default |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 15 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| title* | string | Wordsthe article’s title |
| excerpt | string | Wordsa sentence or two from the article |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the cover picture shows |
| section | string | Wordsthe section it belongs to, e.g. "Guides" |
| author | Author | who wrote it |
| date | string | Wordswhen it was published, as the site writes it |
| readingTime | string | Wordshow long it takes to read, e.g. "6 min" |
| type* | string | Wordsmerchant’s resource type |
| topic | string | Wordsthe topic it belongs to |
| action | string | Actiona named action of the page |
| actionLabel | string | Wordsthe words on the item’s button, instead of the block’s own |
| state | 'upcoming' | 'on-demand' | upcoming: not out yet; on-demand: available now |
| time | string | Wordsmerchant’s session time including timezone |
Author items[].author · 6 props
| Prop | Type | Description |
|---|---|---|
| id | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe person’s name |
| role | string | Wordstheir role or job title |
| company | string | Wordswhere they work |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| url | string | Designa page about them |
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 |
| asset | a picture’s address as your app serves it |
| 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:
items[] - Reads
articlesfrom your app
A help section, for landing, article 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 help blocks
- Panel status board: A dated issue board showing the merchant's own known issues only..
- Resource download cards: a few resources worth showing with their cover: two to eight cards, each with its button; the merchant’s own only.
- Resource download file list: several documents to fetch (catalogue, notices, price lists): a tidy row each, size and format visible; the merchant’s own only.
- Resource download single: one file, one button: a CV, a catalogue, with its format and date; the merchant’s own only.
- Search hero: the help page’s opening: a large search field, suggested searches and the most read articles.
- 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.